- Tanner Helland (dot) Com - http://www.tannerhelland.com -

Custom Image Filter Engine (in VB6)

Posted By Tanner On May 5, 2009 @ 12:00 am In Graphics Code,Programming | Comments Disabled

The ability to create custom filters is a mainstay of any quality graphics application.  A robust matrix-based filter engine can generate hundreds of unique effects by simply adjusting the matrices that get passed into the engine.

In this project, I’ve provided a 5×5 custom filter engine with support for scaling/weighting and biasing/offsetting.  This is identical to the custom filter engine provided by Photoshop, and mine is even slightly faster (at least for the screen-sized images I’ve been testing).

Besides being fast, the engine is also smart.  It is clever enough to estimate edge pixels correctly – even for scaled/weighted filters – and it will automatically validate all input values to make sure they’re appropriate.

Finally, I’ve included 7 sample filters for you to play with, including blur, sharpen, emboss, engrave, grease, unfocus, and vibrate. Below, you can see how each filter looks on a promotional image from Castle [1], an excellent new NYPD dramedy on ABC.

Original:

Blur:

Sharpen:

Emboss:

Engrave:

Grease:

Unfocus:

Vibrate:


Article printed from Tanner Helland (dot) Com: http://www.tannerhelland.com

URL to article: http://www.tannerhelland.com/982/custom-image-filters-vb6/

URLs in this post:

[1] Castle: http://abc.go.com/primetime/castle/index?pn=index

All text copyright © 2008 Tanner Helland. To reduce paper and ink usage, all comments, images, and videos have been suppressed on this printing.