Transparency of input file

This article demonstrates the available options for transparency settings for your input map file. You can find a way, how to correctly get rid of white borders in the final map, or hide black background around the map.

The transparency feature is available only for raster input images, not for vector input files.

Transparency of input file

What is transparency?

Transparency is the functionality that supports transparent areas in an image. If you put any background color under your image, transparent areas will have this background color. This is heavily used in maps, as you can show your image with transparent areas (eg. ragged edges for countries) over the base map.

Opacity is the extent to which something blocks light. It is used to determine how a pixel is rendered when blended with another. The value range is between 0.0 - 1.0 or 0% - 100%; encoded values into Byte range 0 - 255. The value 0.0 (0%, 0) means full transparency - the color pixel will be invisible over the base map (or background color), and the value 1.0 (100 %, 255) means full opaque - the final pixel after blending is defined as only by this pixel color (defined in RGB channels).

Alpha band

Image colors consist of three bands (channels) - Red, Green, and Blue. There is another band, the alpha band, which defines the level of opacity for each pixel (Byte range 0 - 255). If your image has defined an alpha band, MapTiler Engine will use it for the export to a map.

transparency_1.png

MapTiler Engine allows ignoring the 4th band as the alpha band, the Transparency option is called Ignore alpha band. This is a common option for 4-band raster images, where the 4th band is an infra-red channel (eg used for analytics).

Set a color

Instead of using the alpha band as a pixel map for transparency, it is possible to select a specific color, which will be turned into transparency pixels. The very common usage is for white or black borders. The selected color from a system color palette form will be saved and displayed asĀ  NODATA #rrggbb, a hexadecimal representation of the color. The keyword NODATA means that specific color pixels are not useful data (NO-DATA). This keyword is used for the MapTiler Engine argument.

transparency_2.png

Pick a color

Pick a color for transparency is a newly introduced feature of MapTiler Engine 12. It allows the users to pick a color for transparency directly from the processed data, simply by hovering over the respective color with the pointer of their mouse cursor.

transparency_3.png

Make clip cutline

Satellite or aerial images could be missing an alpha band and borders NODATA pixels do not consist of a single-pixel color (black color #000000). MapTiler Engine offers the use of vector geometry (clip cutline) to remove NODATA pixels from the final map.

The clip cutline can be loaded from a vector file (eg. country shapefile from Natural Earth Data).

transparency_5.png

The users can also draw the cutline with the help of an internal tool inside MapTiler Engine.

transparency_4.png

Conclusion

We have learned what is transparency and possible ways how to define and use it with raster images in MapTiler Engine.

MapTiler Engine Manual
Pick a color for transparency