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 GitHub

OpenGraph loader

@Url.ImageWizard().OpenGraph("https://github.com/usercode/ImageWizard").BuildUrl()

/image/Rt_OpNZF8-1NhbtjYFmzmVIG-XwKeBONYu7pCkQuIXw/opengraph/https://github.com/usercode/ImageWizard

Screenshot loader

@Url.ImageWizard().Screenshot("https://github.com").BuildUrl()

/image/uutH4J7mK9uFJFD5w6mH8zde_NjrYm28z3w7jhLRHps/screenshot/https://github.com

SVG transforming

@Url.ImageWizard().FetchLocalFile("img/dot-net-core.svg").BuildUrl()

/image/aAg2oVRNod2px_Nftw7YyR8oCthftHd7l-ULiJ9PBTY/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)

resize(400,800,crop)

resize(400,800,stretch)

resize(400,800,min)

resize(400,800,max)

blackwhite()

Grayscale()

blur()

rotate(90.0)

rotate(180.0)

rotate(270.0)

flip(vertical)

flip(horizontal)

invert()

brightness(0.5)

brightness(0.5)

crop(0.17, 0.22, 0.3, 0.3)

Fetch local file (from wwwroot folder)

@Url.ImageWizard().FetchLocalFile("img/meerkat.jpg").AsImage().Resize(400,400).BuildUrl()

/image/07KvK5NMye6ImuZQfJzMy3Crfjb6IhU1O8Qj71LDR1w/resize(400,400)/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/jiMkpIW11EUqrdH7lU_jFyUxKWoEzWIGHce0JtA4v7I/resize(400,400)/fetch/https://upload.wikimedia.org/wikipedia/commons/b/b7/Europe_topography_map.png

Default

Grayscale

Blur

Placeholder

@Url.ImageWizard().Placeholder(600, 300).BuildUrl()

/image/knvJJLA9oiOgWNlCD-Wr1AWNIUvJtD6zaaEHVtzVxts/placeholder/600x300

600x300

DPR (Device Pixel Ratio)

@Url.ImageWizard().Fetch("lion.jpg").AsImage().DPR(1).Resize(100,100).BuildUrl()

/image/VJ5b1mp3xjvURDYqGGOBCIZtZcKedErbkJ3XE3xzYHg/dpr(1.0)/resize(100,100)/fetch/lion.jpg

DPR 1.0

DPR 2.0

DPR 3.0

Use file provider (IFileProvider)

@Url.ImageWizard().File("img/meerkat.jpg").AsImage().Resize(400,400).BuildUrl()

/image/lKuMZk8Sou4ecbfdtZ0U1Fd-i5gbAxn8lHHBWW6TDuw/resize(400,400)/file/img/meerkat.jpg

Watermark

@Url.ImageWizard().FetchLocalFile("img/bat-eared-fox.jpg", 4).AsImage().Watermark().BuildUrl()

/image/pyWP3vTTvTL-45JlYXpYZIvWnTLw5Tt1C3AaIDV4KUs/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/wVoRyX6-nwPuky-b-qU373pxi6_CMPXalSaIQhXUMKQ/resize(400,400)/drawtext(text='bat-eared-fox',size=65,x=0.3,y=0.1)/fetch/img/bat-eared-fox.jpg?v=O8ad

Fetch youtube thumbnail

@Url.ImageWizard().Youtube("lzyWFew_w8Y").Resize(400,400).BuildUrl()

/image/mTjs2EkRPbNzyd6TC1a1d1e3reBj8N0kmDDnHcglyVQ/resize(400,400)/youtube/lzyWFew_w8Y

Default

Grayscale

Blur

Use youtube taghelper (GDPR friendly)

<youtube video-id="AQHZQ8p6FCA" width="1920" height="1080" grayscale="true" blur="true" use-no-cookie="true" />

Fetch gravatar image

@Url.ImageWizard().Gravatar("MyEmailAddress@example.com").Resize(200,200).BuildUrl()

/image/sJkmLtnpYE2fVi0bImp8umjYO_7FcAnebIceDzrL4vY/resize(200,200)/gravatar/0bc83cb571cd1c50ba6f3e8a78ef1346

Default

Grayscale

Blur

PDF (page to image)

@Url.ImageWizard().FetchLocalFile("/pdf/earth.pdf").AsPdf().PageToImage(0).BuildUrl()

/image/d3-hXsjFnK5vyWAiUlEprtQjwjuGuZ6Y_6EQ0V9NdCw/pagetoimage(0)/fetch/pdf/earth.pdf?v=VGCJTuIh

OpenStreetMap

Use as relay to openstreetmap server.