PRO Test ; Load display colors. LoadCT, 0 TVLCT, 255, 255, 255, !D.Table_Size-2 ; White TVLCT, 0, 255, 0, !D.Table_Size-3 ; Green TVLCT, 255, 0, 0, !D.Table_Size-4 ; Red ; Create the plot in the Z-buffer to insure an 8-bit image ; for output to the PNG file. thisDev = !D.Name Set_Plot, 'Z', /Copy Erase Plot, findgen(11), Color=!D.Table_Size-4, $ Background = !D.Table_Size-2, /NoData OPlot, findgen(11), Color=!D.Table_Size-3 snapshot = TVRD() Set_Plot, thisDev ; Create the transparent vector. Set all values to 255 (opaque). t = BytArr(256) + 255B ; Set the background value (!D.Table_Size-2) to 0 t[!D.Table_Size-2] = 0 ; Create the PNG file. WRITE_PNG,'transparent_test.png', snapshot, r, g, b, TRANSPARENT = t END