ImageWizard
ยป Image processing webservice based on ASP.NET Core and ImageSharp / SkiaSharp
- Based on ASP.NET and ImageSharp / SkiaSharp / SvgNet / DocNET
- Different data loaders: Http, File, YouTube (thumbnail), Gravatar, OpenGraph
- Different data caches: File, Distributed cache, MongoDB cache
- Image filters: resize, crop, rotate,..
- Common image effects like grayscale and blur are available
- Pdf filters: page-to-image for documents
- Url is protected by a HMACSHA256 signature to prevent DDoS attacks
- Can handle the device pixel ratio (DPR)
- Support for cache control and ETag
- Enable range processing by http request
- Use RecyclableMemoryStream for smarter memory management (IStreamPool)
Use the standalone version or middleware.
Go to GitHubOpenGraph loader
@Url.ImageWizard().OpenGraph("https://github.com/usercode/ImageWizard").BuildUrl()
/image/9HhYJy9oosfcZ8DuLZgmInv5ZAxWjvVzMhtsic5Ey94/opengraph/https://github.com/usercode/ImageWizard
Screenshot loader
@Url.ImageWizard().Screenshot("https://github.com").BuildUrl()
/image/sqNHqcWhAhkgbNlnYw0dvT62N_2YT9h6BnVfLbLnedM/screenshot/https://github.com
SVG transforming
@Url.ImageWizard().FetchLocalFile("img/dot-net-core.svg").BuildUrl()
/image/2fhFosotWdAAwmopD4wDsTTJPYOKewF1KygulL4-eqU/fetch/img/dot-net-core.svg?v=7Yo0oNCT
Original (width=100px, height=100px)
RemoveSize()
Rotate(45.0)
Blur()
Grayscale()
Invert()
Saturate(0.3)
Combine filters (grayscale, rotate, invert)
ImageSharp filters
resize(400,800,pad)
/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
resize(400,800,crop)
/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
resize(400,800,stretch)
/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
resize(400,800,min)
/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
resize(400,800,max)
/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
blackwhite()
/blackwhite()/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
Grayscale()
/grayscale()/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
blur()
/blur()/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
rotate(90.0)
/rotate(90.0)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
rotate(180.0)
/rotate(180.0)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
rotate(270.0)
/rotate(270.0)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
flip(vertical)
/flip(vertical)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
flip(horizontal)
/flip(horizontal)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
invert()
/invert()/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
brightness(0.5)
/brightness(0.5)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
brightness(0.5)
/contrast(0.5)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
crop(0.17, 0.22, 0.3, 0.3)
/resize(400,400)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
Fetch local file (from wwwroot folder)
@Url.ImageWizard().FetchLocalFile("img/meerkat.jpg").AsImage().Resize(400,400).BuildUrl()
/image/t37SX9YqYgLTpykvL9h8m6Hy8lb-vyoChlEuQ5UvA24/resize(400,400)/fetch/img/meerkat.jpg?v=B7UZdbtW
/fetch/img/meerkat.jpg?v=B7UZdbtW)
/grayscale()/fetch/img/meerkat.jpg?v=B7UZdbtW)
/blur()/fetch/img/meerkat.jpg?v=B7UZdbtW)
Fetch remote image
@Url.ImageWizard().Fetch("https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png").AsImage().Resize(400,400).BuildUrl()
/image/seFBEzp9B5ezrIzidyTTecEJtkW_-_gl4A6nP5tozBs/resize(400,400)/fetch/https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png
/fetch/https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png)
Default
/grayscale()/fetch/https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png)
Grayscale
/blur()/fetch/https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png)
Blur
Placeholder
@Url.ImageWizard().Placeholder(600, 300).BuildUrl()
/image/RTUJrDebzclTijXU1e_I_DrJqoWUYP7WMsDvZjwJdRU/placeholder/600x300
600x300
DPR (Device Pixel Ratio)
@Url.ImageWizard().Fetch("lion.jpg").AsImage().DPR(1).Resize(100,100).BuildUrl()
/image/jAe_xgXvGVnzlTQr4hKALYR8Xcknpac9pRrJZWEJ1nY/dpr(1.0)/resize(100,100)/fetch/lion.jpg
/resize(100,100)/fetch/img/lion.jpg?v=mwkQv4wt)
DPR 1.0
/resize(100,100)/fetch/img/lion.jpg?v=mwkQv4wt)
DPR 2.0
/resize(100,100)/fetch/img/lion.jpg?v=mwkQv4wt)
DPR 3.0
Use file provider (IFileProvider)
@Url.ImageWizard().File("img/meerkat.jpg").AsImage().Resize(400,400).BuildUrl()
/image/Mk-sFmVEoGWzKOOnO3J-_kGoxxBemEV_mU_lXYvUh00/resize(400,400)/file/img/meerkat.jpg
/file/img/meerkat.jpg)
/grayscale()/file/img/meerkat.jpg)
/blur()/file/img/meerkat.jpg)
Watermark
@Url.ImageWizard().FetchLocalFile("img/bat-eared-fox.jpg", 4).AsImage().Watermark().BuildUrl()
/image/TKAN8Jw5nxEEh_LSWCM7YUYl1Q7r4we75l4hWaw07JY/watermark()/fetch/img/bat-eared-fox.jpg?v=rO6b
/watermark()/fetch/img/bat-eared-fox.jpg?v=rO6b)
Draw text
@Url.ImageWizard().FetchLocalFile("img/bat-eared-fox.jpg", 4).AsImage().Resize(400, 400).DrawText("bat-eared-fox", 65, 0.3, 0.1, false).BuildUrl()
/image/Hq1Q9xrHSk1lu_WnLSTGOJypjYenlyeg2pqJ4tfbQ2A/resize(400,400)/drawtext(text='bat-eared-fox',size=65,x=0.3,y=0.1)/fetch/img/bat-eared-fox.jpg?v=rO6b
/drawtext(text='bat eared fox',size=65,x=0.3,y=0.1)/fetch/img/bat-eared-fox.jpg?v=rO6bJIBN)
Fetch youtube thumbnail
@Url.ImageWizard().Youtube("lzyWFew_w8Y").Resize(400,400).BuildUrl()
/image/x_js5_nWZy-i5IhnHV10570LnQpdIShjp3REVIXGwJI/resize(400,400)/youtube/lzyWFew_w8Y
Default
Grayscale
Blur
Use youtube taghelper (GDPR friendly)
Fetch gravatar image
@Url.ImageWizard().Gravatar("MyEmailAddress@example.com").Resize(200,200).BuildUrl()
/image/latYKU9dnzeGlj396g0U9AfiVHgyIoYE5Q2rEpjGCLI/resize(200,200)/gravatar/0bc83cb571cd1c50ba6f3e8a78ef1346
Default
Grayscale
Blur
PDF (page to image)
@Url.ImageWizard().FetchLocalFile("/pdf/earth.pdf").AsPdf().PageToImage(0).BuildUrl()
/image/sAClwjYU1RKS-DGVQyZL7z1agl3GQUyuSSTmfg_3VFU/pagetoimage(0)/fetch/pdf/earth.pdf?v=Sr59Cabh
OpenStreetMap
Use as relay to openstreetmap server.