Custom Image Filter Engine (in VB6)

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, an excellent new NYPD dramedy on ABC.

Original:

castle

Blur:

castle_blur

Sharpen:

castle_sharpen

Emboss:

castle_emboss

Engrave:

castle_engrave

Grease:

castle_grease

Unfocus:

castle_unfocus

Vibrate:

castle_vibrate

 

DISCLAIMER: These download files are regularly scanned to ensure they remain free from malicious content. Unfortunately, some virus scanners will flag these .zip files as suspicious simply because they contain source code and/or executable files. I have submitted my projects to a number of companies in an attempt to rectify these false-positives. Some have been cooperative. Others have not. If your virus scanner alerts you regarding these files, please allow the file to be submitted for further analysis (if your program allows for that). This should help ensure that any false-positive warnings gradually disappear for all users.

This site - and its many free downloads - are 100% funded by donations. Please consider a small contribution to fund server costs and to help me support my family. Even $1.00 helps. Thank you!

Real-time Image Curves (using cubic splines) in VB6

By request, here is the first of its kind in VB: a fast, accurate, real-time image curves dialog.

Curves is similar in theory to both “Image Levels” and standard gamma correction, but it provides a much more powerful interface for adjusting the luminance of an image.  This project provides results very similar to Photoshop’s, and it allows the creation of more spline knots (32 instead of 16).  The cubic spline code on which I based my code was taken from Jason Bullen’s excellent “Simple Cubic Spline Curve Plot” (available at Planet Source Code).

The code is well-commented and very fast – please post comments, requests for future Photoshop-related code, and many heaps of praise (as this was a complicated routine to reverse-engineer…!).

Believe-it-or-not, this is a legitimate application of calculus.  Who knew such a thing existed? :)

 

DISCLAIMER: These download files are regularly scanned to ensure they remain free from malicious content. Unfortunately, some virus scanners will flag these .zip files as suspicious simply because they contain source code and/or executable files. I have submitted my projects to a number of companies in an attempt to rectify these false-positives. Some have been cooperative. Others have not. If your virus scanner alerts you regarding these files, please allow the file to be submitted for further analysis (if your program allows for that). This should help ensure that any false-positive warnings gradually disappear for all users.

This site - and its many free downloads - are 100% funded by donations. Please consider a small contribution to fund server costs and to help me support my family. Even $1.00 helps. Thank you!