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/oBHaIWAI6c3YsC-d39b1jlISJ-qk7XNwOKxQ9N3K7_4/opengraph/https://github.com/usercode/ImageWizard
Screenshot loader
@Url.ImageWizard().Screenshot("https://github.com").BuildUrl()
/image/HuySus0vlmglgusQeW69oS4dTbQgsSuZMqmqtwBPb_4/screenshot/https://github.com
SVG transforming
@Url.ImageWizard().FetchLocalFile("img/dot-net-core.svg").BuildUrl()
/image/WUxl39vZMAS13Lhl4ODDcfSazR7L1hSGQywZoubeM7w/fetch/img/dot-net-core.svg?v=JQDUYJdp
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=O8adq-RY)
resize(400,800,crop)
/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
resize(400,800,stretch)
/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
resize(400,800,min)
/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
resize(400,800,max)
/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
blackwhite()
/blackwhite()/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
Grayscale()
/grayscale()/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
blur()
/blur()/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
rotate(90.0)
/rotate(90.0)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
rotate(180.0)
/rotate(180.0)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
rotate(270.0)
/rotate(270.0)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
flip(vertical)
/flip(vertical)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
flip(horizontal)
/flip(horizontal)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
invert()
/invert()/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
brightness(0.5)
/brightness(0.5)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
brightness(0.5)
/contrast(0.5)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
crop(0.17, 0.22, 0.3, 0.3)
/resize(400,400)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
Fetch local file (from wwwroot folder)
@Url.ImageWizard().FetchLocalFile("img/meerkat.jpg").AsImage().Resize(400,400).BuildUrl()
/image/MnIqdXTRYKbH3hnT36UGC4oSqFQchZhcBSP_QmJQQuQ/resize(400,400)/fetch/img/meerkat.jpg?v=ruMCmWgs
/fetch/img/meerkat.jpg?v=ruMCmWgs)
/grayscale()/fetch/img/meerkat.jpg?v=ruMCmWgs)
/blur()/fetch/img/meerkat.jpg?v=ruMCmWgs)
Fetch remote image
@Url.ImageWizard().Fetch("https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png").AsImage().Resize(400,400).BuildUrl()
/image/CX8ByIUBXIJyOLTQ1xtr6bilpAnl3jZ-3CFMODXeWwc/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/TLDUtLrvBd6cDIewUo4nvaM-Ver1HeXD1Nj__phEiyE/placeholder/600x300
600x300
DPR (Device Pixel Ratio)
@Url.ImageWizard().Fetch("lion.jpg").AsImage().DPR(1).Resize(100,100).BuildUrl()
/image/2nMdWtJ0Oy70lVu5dpePrh8Wlo0GAHz47yQA66Fa9NY/dpr(1.0)/resize(100,100)/fetch/lion.jpg
/resize(100,100)/fetch/img/lion.jpg?v=4OTmL1n9)
DPR 1.0
/resize(100,100)/fetch/img/lion.jpg?v=4OTmL1n9)
DPR 2.0
/resize(100,100)/fetch/img/lion.jpg?v=4OTmL1n9)
DPR 3.0
Use file provider (IFileProvider)
@Url.ImageWizard().File("img/meerkat.jpg").AsImage().Resize(400,400).BuildUrl()
/image/kwuyOytus_ntog0-jt3D7nWXGQE8zulpn9bLdY0JcYc/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/vEfF1RS4qApXntaZxNElMPR_yxODU0j2KgOPKCpdjXc/watermark()/fetch/img/bat-eared-fox.jpg?v=O8ad
/watermark()/fetch/img/bat-eared-fox.jpg?v=O8ad)
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/w0FThxn6s3RI2qGPBeKTeENEsXlrO-PJQlghgAGqkm4/resize(400,400)/drawtext(text='bat-eared-fox',size=65,x=0.3,y=0.1)/fetch/img/bat-eared-fox.jpg?v=O8ad
/drawtext(text='bat eared fox',size=65,x=0.3,y=0.1)/fetch/img/bat-eared-fox.jpg?v=O8adq-RY)
Fetch youtube thumbnail
@Url.ImageWizard().Youtube("lzyWFew_w8Y").Resize(400,400).BuildUrl()
/image/Eyoiw18wSxtJZd40PqksLe1vaohVlOg9FuYU0zYV0_c/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/-IST808-64-mZyCwelmpqBfBVazaMlKLgful3wrYtKs/resize(200,200)/gravatar/0bc83cb571cd1c50ba6f3e8a78ef1346
Default
Grayscale
Blur
PDF (page to image)
@Url.ImageWizard().FetchLocalFile("/pdf/earth.pdf").AsPdf().PageToImage(0).BuildUrl()
/image/gK_QnjQWRq6OKCw-82_oTOhIOayZ_URuLa2zBufnEHY/pagetoimage(0)/fetch/pdf/earth.pdf?v=VGCJTuIh
OpenStreetMap
Use as relay to openstreetmap server.