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/h-9G-29z-kWiNRTPlurMjYnuvus2mtE2AtlXzZtF598/opengraph/https://github.com/usercode/ImageWizard
Screenshot loader
@Url.ImageWizard().Screenshot("https://github.com").BuildUrl()
/image/LOzmf41XglhfHEvGWXl1k_S8xM7POkntH3Agry0R6ps/screenshot/https://github.com
SVG transforming
@Url.ImageWizard().FetchLocalFile("img/dot-net-core.svg").BuildUrl()
/image/jW72kxIUyqchHOyFTHW1gd5ePSwD5oJwrAhhkyYbxnA/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/bMBsXt5tSCDxLEuaVt4H_PgLKB9N6WMaWDDQe0nFjJc/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/GHenvBBRHlAmmnjinyf0xVTEHhy5pVB6iSZCPzq77tQ/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/hEE2_ZZ3w3HdB46R-I3eEUr26XRKrzzlbIuk34WqiO4/placeholder/600x300
600x300
DPR (Device Pixel Ratio)
@Url.ImageWizard().Fetch("lion.jpg").AsImage().DPR(1).Resize(100,100).BuildUrl()
/image/EZVojCoc0ZB4JKkfC_rFSlpwyhC_nAO87ojj8YauiNI/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/Gegxz7dZYoc_FU_1aAwHfG08oPs_fSHEZJ30koWv_jw/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/IiW9ByRSXBglxXB25m8nwXi_GuFklLkuZOME65g4JrU/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/G1dyVhaz2LnRYJigDDntx5oHBN4KeCnHBLMI7-udwpU/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/EO7a5fsqmCOvL3XejwqjK-6yaM2Tx2I4IBQVPhG-Df4/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/LSbnn5g-gyJrP99PpTeg1TKW_kEZqk1W0vFzNYRw8TM/resize(200,200)/gravatar/0bc83cb571cd1c50ba6f3e8a78ef1346
Default
Grayscale
Blur
PDF (page to image)
@Url.ImageWizard().FetchLocalFile("/pdf/earth.pdf").AsPdf().PageToImage(0).BuildUrl()
/image/-twnsuDvqPzSFZVeDVk5BqnZAK1tgHVlaB1-vpn1Wh4/pagetoimage(0)/fetch/pdf/earth.pdf?v=Sr59Cabh
OpenStreetMap
Use as relay to openstreetmap server.