SimpleFilters plugin

This plugin provides grayscale, sepia, brightness, saturation, contrast, inversion, and alpha filtering options. It also includes beta support for rounded corners.

These filters are implemented as adjustment matrices and are processed by native code for very high performance.

  • Rounded Corners

    s.roundcorners=30

  • Rounded Corners

    s.roundcorners=45,0,45,0

  • Easy Greyscale

    s.grayscale=ry

  • Easy Greyscale

    s.grayscale=ntsc

  • Easy Greyscale

    s.grayscale=bt709

  • Easy Greyscale

    s.grayscale=flat

  • One Step Sepia

    s.sepia=true

  • Color Inversion

    s.invert=true

  • Opacity

    s.alpha=0.2

  • Opacity

    s.alpha=0.4

  • Opacity

    s.alpha=0.6

  • Opacity

    s.alpha=0.8

  • Contrast

    s.contrast=-0.8

  • Contrast

    s.contrast=-0.4

  • Contrast

    s.contrast=0.4

  • Contrast

    s.contrast=0.8

  • Contrast

    s.contrast=1

  • Saturation

    s.saturation=-1

  • Saturation

    s.saturation=-0.75

  • Saturation

    s.saturation=-0.5

  • Saturation

    s.saturation=-0.25

  • Saturation

    s.saturation=0.25

  • Saturation

    s.saturation=0.5

  • Saturation

    s.saturation=0.75

  • Saturation

    s.saturation=1



Refresh for another image.

Installation

Either run Install-Package ImageResizer.Plugins.SimpleFilters in the NuGet package manager, or:

  1. Add ImageResizer.Plugins.SimpleFilters.dll to your project
  2. Add <add name="SimpleFilters" /> inside <resizer><plugins></plugins></resizer> in Web.config.

Usage (v3.1+)

Note the order in which effects are applied MAY CHANGE in future releases.

  • s.grayscale=true|y|ry|ntsc|bt709|flat (true, ntsc, and y produce identical results)
  • s.sepia=true
  • s.alpha= 0..1
  • s.brightness=-1..1
  • s.contrast=-1..1
  • s.saturation=-1..1
  • s.invert=true
  • s.roundcorners=radius|topleft,topright,bottomright,bottomleft - 'radius' is a percentage between 0 and 100 of 1/2 the smaller of width and height. You can crop to a circle with width=x&amp;height=x&amp;mode=crop&amp;s.roundcorners=100

Examples

Original image

Evenly rounded

s.roundcorners=30

s.roundcorners=30

Specify individual radii

s.roundcorners=45,0,45,0

s.roundcorners=45,0,45,0

4 ways to grayscale

s.grayscale=true|y|ry|ntsc|bt709|flat (true, ntsc, and y produce identical results)

The following examples use NTSC/Y/True, RY, BT709, and Flat respectively

s.grayscale=true s.grayscale=ry s.grayscale=bt709 s.grayscale=flat

1 way to sepia

s.sepia=true

s.sepia=true

Inversion

s.invert=true

s.invert=true

Adjust opacity/alpha

s.alpha = 0..1

For true transparency, combine with format=png. Otherwise, the image will be blended against bgcolor.

s.alpha=0.25 s.alpha=0.75 s.alpha=0.85 s.alpha=1

Adjust contrast

s.contrast = -1..1

s.contrast=-0.80 s.contrast=-0.80 s.contrast=-0.40 s.contrast=-0.20

s.contrast=0

s.contrast=0.20 s.contrast=0.40 s.contrast=0.80 s.contrast=0.99

Adjust brightness

s.brightness=-1..1

Adjust saturation

s.saturation = -1..1

Legacy syntax (Before v3.1)

  • &filter=grayscale
  • &filter=sepia (didn't work)
  • &filter=brightness(.1) (-1..1) (Change .1 to the brightness offset you want)
  • &filter=alpha(.5) (Change .5 to the alpha multiplier you want)

This plugin (SimpleFilters plugin) is part of the Creative Edition

Where is the plugins section?

The <plugins> section is located in Web.config, and is nested inside the <resizer> element, which is nested inside <configuration>. For examples, see this sample Web.config file.

Where can I find the dll?

We prefer that you install via NuGet, but you can also find the plugin DLL files in the /dlls/release folder of your download.

How do I typically install a plugin via Web.Config?

  1. In Visual Studio, right click on your project and choose "Add reference". Browse to the plugin DLL and click "OK".
  2. In the <plugins> section of Web.config, insert <add name="PluginName" />
  3. Look at the plugin documentation to see what configuration options (if any) are available.

How do I typically install a plugin via code?