VLBV web page header.gif

Merge Multiple Monochrome Files into a Single Greyscale Image

December 3, 2021

We recently were asked to add a special function to VLBV - the ability to merge a number of monochrome bitmaps into a single greyscale image. The application is somehow related to creating an inspection reference from the layout data used to make a substrate.

The source is normally layout data such as Gerber, GDSII or ODB++ in which visible layers are rasterized to monochrome bitmaps. For example, If you are scanning a finished substrate then what your camera will "see" is the solder mask, the top layer of metal and possibly the effect of any drill holes as they pass through a metal via.

Gerber files are rasterized into monochrome bitmaps

However these monochrome bitmaps are not what the "camera" sees at all. Instead, what is reflected back to the camera is some combination of these three "layers" due to the fact that some of them (such as soldermask) are semi-transparent. What reflects back to the camera from such a substrate?

Each of these combinations generates a different level of reflectance to the camera. So if you want to use your design data as an inspection reference, you need to generate a bitmap the closely emulates the reflectance levels. And since most inspection cameras operate in grey-scale what you want is a grey-scale image as your reference.


Merge Mono to Grey

VLBV's new Merge Mono to Grey function does exactly this. It enables the user to load multiple monochrome files (up to 8 maximum) and reads a user-defined "merge" table to control the grey level for any combination of layers that are present at each pixel in the stacked up bitmaps.

Multiple monochrome images converted to a single greyscale using a merge table lookup.

If the user has done a proper job of setting up the merge table, then the resulting greyscale image should match closely what a camera will "see." By comparing the camera image to the reference image the inspection equipment can tell whether the manufactured product is correct; any differences should then reflect a defect in the manufacturing process and can be flagged for additional inspection.


The Merge Table

The merge table maps the combination of pixel values for the input layers to an output grey scale level. This can best be described by an example and some illustrations.

Let's assume we are merging three input layers: LayerA, LayerB and LayerC to produce a single grey scale output. The layer's are stacked in this order:



Each combination of pixel values is assigned a grey level

As one can see from the illustration above, with three input layers there are a total of 8 possible combinations of monochrome pixels - where Artwork treats 0=white and 1=black.

For each of these combinations the table will also contain (user defined) a grey scale value ranging from 0 to 255 (where 255=black and 0=white). So at each pixel location, one will have a grey value that is a function of the three input pixels.


Merge Table Syntax

The syntax of the merge table is described below:

# 3 Layer Merge Table            comment lines start with #

# Number of Layers to Merge      
LAYERS 3                         required

# Default Grey Value             if the table is not complete         
DEFAULT 0                        and a combination encountered
                                 that is not defined, this grey
                                 value will be used.

# merge table data
000 0
001 80
010 100
100 120
011 180
101 200
110 220
111 255

If we use the previous illustration and enter the grey values from this merge table we get the following:

grey values from merge table


Next: Three Layer Example