Response to request by Jenn Thomas on 10th July 1998 ...

ELIMINATING WHITE FROM AN IMAGE - Some time ago I was looking for an easy way to mask / delete the white background from a scanned line drawing, so it would be easier to overlay the image on a background. I did a few experiments with Filter Factory and this is one example :

Filter Factory KNOCKOUT Filter Example



START IMAGE :

New canvas with red background for the purpose of showing the transparency.

SCANNED IMAGE :

This is a small part of a scanned lineart sketch, with fine details which are hard to mask using normal methods. The image was pasted on a new layer above the red background.

PHOTOSHOP MASKING :

Using Photoshop's "colour range" masking facility the white was selected and deleted, leaving the red background show through. Notice that you loose a lot of detail in the lineart.

KNOCKOUT FILTER :

Using the FF Knockout filter, settings R:0, G:0, B:0, A:255, the white background is eliminated BUT the lineart is much more clear.

LAYER TRANSPARENCY :

If you load the layer transparency, you will see the marquee around the lineart. You can now add drop-shadows, glows, etc to the selection if you wish.

DROP-SHADOW EXAMPLE :

A quick example where the lineart has been inverted and a drop-shadow added using the layer transparency.

ADDING A BACKGROUND :

The bottom layer can be filled with a complex background and the lineart will still be neat with no awful white "fringe" around the edges.


The Filter Code

R: ctl(0)+r-255
G: ctl(1)+g-255
B: ctl(2)+b-255
A: 128-(((128-ctl(3))*(128-b))/128)

Settings for this example :

ctl(0) : 0
ctl(1) : 0
ctl(2) : 0
ctl(3) : 255

This filter was a hybrid of various bits of code found in other filters. I can't rememeber which ones, so if you recognise your code here let me know!

I wanted this filter mainly for masking mono lineart, but it also works fine with colour images. You can "knockout" the white OR black from any image. It takes a bit of experimenting with the settings to see how it works though.