Background Transparency for PNG Output via the Render Tool

If a temporary PNG or a specific output of a type of PNG is chosen in the Render Tool, there will be extra controls displayed in the Properties panel. One of these properties is “Background”.

>Basically, this allows you to set a background color for the PNG. However, you may notice that there is also a “Transparent” check box associated with that property. If this is checked, then the color chosen will be set in the output PNG as a “transparent” color, for any viewing applications that honor a transparent color. In those applications, whatever pixels in the PNG that are that color, the application will cause to be transparent, allowing any background to show through. For example, if you choose a transparent background color of “Magenta”, and open the output PNG in the Windows Photo Viewer (which honors transparent colors), the background will be the window background color (usually white). If you view the same PNG in Microsoft Paint (which does not honor transparency), the background will indeed be displayed as magenta.

Note that the behavior of using a transparent color is different from using a simple mask (which marks that a pixel is either “in” or “out” of the transparent part of the image, regardless of the color of the pixel), or a mask which contains percentages of opacity, allowing transparent parts of the PNG to blend with whatever color makes up the background on top of which the output PNG is placed in a viewing application.

Because of this, there are some considerations when using this. First is that, should the color chosen be identical to another color chosen for some object within the output, then the parts of that object that are the same color will also be transparent. (It does not affect just the background.) For example, if you were to choose “White” as the transparent color, and you also have a chart in the output which has a white background to the chart area portion of the chart, not only will the background for the PNG be considered transparent, but also the parts of the chart area that are white will also be considered transparent.

Second, to actually have transparency applied by the application displaying the PNG, the pixel must be exactly the color set as transparent. With that, you must also consider that the engine that generates the PNG will do anti-aliasing (especially important for text). It will create pixels that are varying blends of the background and foreground colors around the edges of drawn objects, to fool your eye into seeing smooth shapes and curves. Therefore, you will tend to get fine “halos” around non-transparent objects that are on top of the transparent background color. For example, if you were to choose “Magenta” as the background color, and you had black text in the output, you may notice a subtle pink halo around each letter, where the anti-aliasing has created the blended colors. Since those “shades of pink” aren’t exactly “Magenta”, they will not be considered transparent by the application in which you are viewing the PNG.