AdvancedFilters plugin

Apply advanced effects to your images. Requires Full Trust.

The plugin currently applies effects to the image along with any background color, padding, or drop shadow that may be present. Future versions may simply apply the effect to the image, not the surrounding area. Note: does not affect borders or watermarks.

  • Canny Edge Detector

    a.canny=true

  • Sepia

    a.sepia=true

  • Automatic Histogram Adjustment

    a.equalize=true

  • White Balance

    a.balancewhite=true

  • White Balance

    a.balancewhite=area

  • White Balance

    a.balancewhite=simple

  • White Balance

    a.balancewhite=gimp

  • White Balance

    a.balancethreshold=0.06

  • White Balance

    a.balancethreshold=0.6

  • Contrast

    a.contrast=-0.1

  • Contrast

    a.contrast=0.1

  • Saturation

    a.saturation=-0.2

  • Saturation

    a.saturation=0.2



Refresh for another image.

Installation

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

  1. Add ImageResizer.Plugins.AdvancedFilters.dll to your project. Make sure AForge.dll, AForge.Math.dll, and AForge.Imaging.dll are copied also, although they do not need to be referenced directly.
  2. Add <add name="AdvancedFilters" /> inside <resizer><plugins></plugins></resizer> in Web.config.

Usage

  • Gaussian blur with adjustable radius: &a.blur=radius
  • Gaussian sharpen with adjustable radius: &a.sharpen=radius

Alpha effects (may change or disappear without notice)

Please note the following effects are only preset for evaluation. If you like one and find a practical use for it, please let me know! Otherwise it might disappear to reduce the code surface area.

Also, note the order in which effects are applied WILL CHANGE in future releases. Don't combine them if you want repeatable results.

The names for these will probably also change in future releases.

Contrast, saturation, and brightness adjustment

Hint: Start with values between -0.1 and 0.1. Values have a big effect.

  • a.contrast=-1..1
  • a.saturation=-1..1
  • a.brightness=-1..1

Automatic white balance (alpha feature of v3.3.0+)

Automatically corrects the white balance of the photo with 1 of 3 algorithms.

  • area - Threshold is applied based on cumulative area at the lower and upper ends of the histogram. Much larger thresholds are required for this than SimpleThreshold.
  • simple - Simple upper and lower usage thresholds are applied to the values in each channel's histogram to determine the input start/stop points for each individual channel. The start/stop points are used to calculate the scale factor and offset for the channel.
  • gimp - Threshold is applied based on strangely skewed cumulative area, identical to the process used by GIMP.

The default (and recommended) algorithm is 'area'.

  • &a.balancewhite=true|area|simple|gimp
  • &a.balancethreshold=0.6|0.06 (simple white balance requires a smaller threshold.)

For the area and gimp algorithms, the default threshold is 0.6. For simple 0.06 is used (as it is not compared against cumulative area, but an individual value's usage)

Automatic histogram adjustment (Good for daylight photos)

Adjusts contrast, saturation, and brightness with curves based on the histogram. Good for adjusting slightly foggy or dark daytime photos.

  • a.equalize=true

Sepia

Sepia effect, slightly different from the one in SimpleFilters… going to evaluate which is best.

  • a.sepia=true

Oil Painting effect

Try 1 for impressionist, 100 for modern art ;)

  • a.oilpainting=1..100

Noise removal

Not a blur effect - designed to remove color noise, 'pepper noise'. Very conservative, doesn't affect edges.

  • a.removenoise=1-100

Sobel energy filter

Useful only for debugging why whitespace trimmer isn't working on an image.

  • a.sobel=true

Note - you can also threshold the sobel filter into black and white with &a.threshold=0-255

Canny Edge Detector

Displays edges as lines. Aggressive.

  • a.canny=true

This plugin (AdvancedFilters 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?