All Graphics Code Articles

Grayscale demonstration

Seven grayscale conversion algorithms (in VB6)

At long last, here is the most-requested image processing technique for this site – a comprehensive collection of grayscale conversion techniques. To my knowledge, this is the only project on the Internet that presents 7+ unique grayscale conversion algorithms, including two written from scratch for this very project.

LittleBigPlanet - diffuse filter

Real-time Diffuse (Spread) Image Filter in VB6

A software-based “diffuse filter” – random displacement of image pixels within a specified radius – was used in a number of SNES, Genesis, and DOS games to simulate an explosion effect. Today’s project provides the source code for generating a diffuse effect in real-time.

Enslaved poster - blue colorization

How to Colorize an Image (in VB6)

“Colorization” in image processing can refer to one of several things. One form of “colorization” is taking any image – including full-color ones – and applying a uniform color for dramatic or artistic effect. This is the type of colorization filter provided by software like Photoshop and GIMP, and it’s also the effect this project implements.

Same two images as the first stained glass example - just the blending mode has changed.

Stained Glass Effect (using VB6 and GIMP)

I wanted to title this article “a novel method for matrix randomization using polygons and custom differential post-processing blending”… but that was a bit long, even for me…

bayonetta_emboss

Generating Emboss / Engrave / Relief Filters (in VB6)

Basic emboss and engrave filters are two of the simplest image processing features to implement. Both operate on the same principle – for each pixel, subtract the RGB values of one or more neighboring pixels in a particular direction. This leads to an image where low-contrast areas are all black, while high-contrast areas (edges) are varying colors of brighter intensity. Most emboss/engrave filters add 127 to the RGB values so that uniformly contrasted areas are gray. I’ve added a “color” option to my implementation, so you can emboss/engrave an image to any hue. In the Bayonetta example above, the left side of the picture is embossed to something around #81a3fe…

Mandelbrot_VB6_4

Drawing the Mandelbrot Set / Fractal (in VB6)

Today’s very cool project demonstrates a proof of concept implementation for rendering the famed Mandelbrot set (or “Mandelbrot fractal”) using VB6. It’s a bit of a feat, since VB6 isn’t exactly optimized for recursion-heavy calculations…but you know me. I love making VB do things it was never meant to do! :)

"Antiquified" version of a BBT promo photo

Sepia / “Antique” Image Effect (in VB6)

I’m guessing you’ve seen this style of image before – a sort of pseudo-antique filter than can make any image look like it was taken with a very old camera. There are many ways to programmatically generate images like this, and in this article I’ve put together one that does more than just make the image look “brown.” This filter involves several steps (fading, multiplicative brightness, and gamma correction, among others) and results in a conversion that not only adds a sepia coloring, but also gives an image a histogram more in keeping with older photos.

Final Fantasy Versus XIII - Rainbow Effect

Nature-Inspired Image Filters (in VB6)

Today’s article brings a collection of random image effects that can be quickly (and programmatically) generated. In an attempt to give the project some coherency, I’ve named each effect after something “nature-themed” so as to help distinguish them. As always, full source code and a sample .exe is provided…

castle_emboss

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 be used to create tens – even hundreds – of unique image effects by simply manipulating the matrices that get passed into the engine. In this project, I’ve provided a 5×5 custom filter engine with support for both scaling and biasing. 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)…

lost_5

Edge Detection (in VB6)

Edge detection (also called “boundary detection”) is a fundamental problem in image processing. The ability to accurately detect visible “edges” in an image has many applications – from missile targeting to OCR to cool Photoshop effects. In this project, I’ve compiled 6 well-known edge detection algorithms (along with two of my own). Full VB6 source code is provided.