Using Transparency

There are two primary uses for transparency.
  • To produce output with a transparent background. For example, you might want to add your output to a Web page that already has a specific background color or image. Output that has a transparent background allows the background on the Web page to show through. The following devices produce a transparent background by default.
    • PNGT and UPNGT
    • SVGT
    In addition, the following devices produce output with a transparent background when you also specify the TRANSPARENCY option in the GOPTION statement:
    • GIF
    • PNG, PNG300, and UPNG
    • SVG, SVGVIEW, and SVGZ
  • To produce output with semi-transparent colors. Semi-transparent colors are particularly useful when you want to add annotations to your output while allowing the underlying graph or map to show through the annotations. Semi-transparent colors, when annotated on top of each other, blend together (alpha blending). In the following images, the red, green, and blue circles are all semi-transparent (in this case, 50% opaque). The yellow background in the first image is totally opaque. You can specify semi-transparent colors with the RGBA color mode. See RGBA Color Codes for information.
    image showing semi-transparent colors
    The following devices use semi-transparent colors when the transparency is specified with RGBA color codes.
    • PNG, PNGT, PNG300, UPNG, and UPNGT