ImageProcessor 2.1.0 Released!

Today marks the release of the latest version of ImageProcessor My super, fantastic open source imaging library.

This is a pretty big release with a multitude of new functionality, performance improvements and bug fixes. I'll run through some of them here and try not to ramble on too much in the process. It's gonna be very image heavy so I recommend a broadband connection.

New Stuff

Pixelate

This new method allows you to pixelate an image by passing a pixel size to the ImageFactory in the following format.

public ImageFactory Pixelate(int pixelSize, Rectangle? rectangle = null)

If a rectangle is passed that will constrain the method to only pixelate a portion of the original image.

Original

Original picture of a really cool bear

Pixelated

Pixilated picture of a really cool bear

Cool eh?


DetectEdges

This method allows you to detect points within an image where the brightness changes sharply. There's lots of different algorithms available to do this using some pretty wild maths see Wikipedia.

The method is called as follows.

public ImageFactory DetectEdges(IEdgeFilter filter, bool greyscale = true)

I've added 9 different detection methods to get started with.

  • KayyaliEdgeFilter
  • KirschEdgeFilter
  • Laplacian3X3EdgeFilter
  • Laplacian5X5EdgeFilter
  • LaplacianOfGaussianEdgeFilter
  • PrewittEdgeFilter
  • RobertsCrossEdgeFilter
  • ScharrEdgeFilter
  • SobelEdgeFilter

Here an example of it in action using the PrewittEdgeFilter

Original

Original picture of a bridge

Edges Detected

Greyscale picture of a bridge with edges detected

Edges Detected - Keeping Original Colours

Picture of a bridge with edges detected

Edge detection is one of the fundamental tools of image processing. I use it internally for this method.


EntropyCrop

This one I built for my good friend Jeavon Leopold who preyed upon by inability to resist a challenge. It looks for the area of highest entropy within an image and crops around it. It works particularly well with images containing large areas of a single color or similar colors around the edges.

public ImageFactory EntropyCrop(byte threshold = 128)

Original

Picture of a field

Cropped to Area of Highest Entropy

Picture of a field cropped


There's three other new methods added to the Imagefactory class but I'll just link to the docs as I don't want to go on.

Moar New Stuff

In this release I've also managed to add a shiny new quantizer based on a vastly improved version of nQuant. This dramatically improves the output of indexed png files. Considering these images contain only 256 colors the output is extraordinary!

Original

New York Scene

Indexed PNG

New York Scene


Performance

Performance under the hood has been vastly improved. Using a combination of Parallelisation techniques and a new FastBitmap class I was able to improve methods such as GaussianBlur by up to 7X which was very pleasing. Every single method that could be has been rewritten to take advantage of the new techniques which has made ImageProcessor purr like a wolverine.

I've also been testing continuously to ensure that memory usage is kept consistently low - I'm very pleased with the results.


Bug Fixes

Version 2.1 now correctly handles images of different resolutions. In some circumstances it was possible to throw certain combinations of methods off like Resize and Rotate for example by passing them an image of a higher resolution than the default 96dpi. This has now been fixed.

I've also fixed a timing ( rounding error) issue within animated gifs and an encoding one which was making them impossible to share on Twitter. You can now share them anywhere you like.

On that note I bet you didn't realise that all the methods can be applied to animated gifs did you?

Pixelated, rotated Kirk


Anyhoo

I hope this has got you all excited and you find it useful.

This release has been a LOT of hard work and as ever if you think you can help in anyway then please do. The .NET community needs a tool like this and I can only keep supporting and improving it with your help to please Get Involved.

comments powered by Disqus