X Tutup

ShoeBox

Mask Image

Masks a 24 bit image (e.g from your clipboard or from a image file without alpha channel). The way this works is by assuming that the upper left pixel at 0,0 represents a solid background color. Because of this not every kind of image is suited for this. Illustrations, drawings or rasterized vector graphics however work really well.

The upper image shows the steps this tool calculates automatically: An alpha channel based on a difference blend, a color bleed of the safe mask area and a final composite result.

Video

What is the Technique?

It might help a little bit to understand what this tool actually does behind the scenes.

  1. The clipboard or dropped file is read.
  2. The first upper left pixel at 0,0 is picked and a new layer with a solid fill of that color is added and set to a difference blend mode.
  3. This difference blend is enhanced in a way that the greatest values out of the R,G,B spaces are multiplied with a scalar. This will be used for the final alpha channel.
  4. A new temporary alpha channel with a high threshold (only full opaque pixels) is generated and applied on the input bitmap.
  5. This temporary masked result padded with bleeding border colors
  6. The final composite is a result of the temporary color bleend and the difference mask from the first steps.

Settings

Some of the settings more in detail. If you are lost with the settings click on the template button the default one to reset the settings.

• colorOrgFadeIn
A normalized float that defines how much the original source image is applied on top of the color bleed composite to rethrieve original colors. Values can range from 0.001 to 1.0. A value of 1.0 will add a original input image intially masked on top of the color bleed. Set the value to below 0.5 to get out some more original bleeding color.
• maskContrastMultiplier
A multiplier that is added to the generated alpha channel to boost its positive areas. A good low value is 2.0 which hardly enhances the positive fill. A value of 7.0+ will boost the white in the alpha channel but might also cause aliasing on the edges of the objects.
• cropAlpha

Crop the result to its new alpha channel to keep only what's necessary.

 

• saveSeperateColorAndAlpha
If set to true it saves 3 individual files: The grayscale alpha channel, the color bleeding channel and the final composite result.
If set to false it will save only the composite result.
• fileNameAlpha
The individual file name for the grayscale alpha channel.
• fileNameRGB
The individual file name for color bleeding channel.

Example masked images

The original image had a white background and in this case it even masked some of the skin tones with it. You can also see the bleeded color channel that reconstructed all the full skin tones.

The next example was extracted from an aquarell painting. All the soft transitions and anti aliasing on the strokes are all nicely preserved.

X Tutup