I would like to confirm my interpretation of the PNG file format description is correct with color type 0x02 and with tRNS chunk present. It says on PNG website that:
For colour types 0 or 2, two bytes per sample are used regardless of the image bit depth (see 7.1: Integers and byte order). Pixels of the specified grey sample value or RGB sample values are treated as transparent (equivalent to alpha value 0); all other pixels are to be treated as fully opaque (alpha value 2bitdepth-1). If the image bit depth is less than 16, the least significant bits are used and the others are 0.
Give this same tRNS Chunk:
Length: 6
Type: tRNS
Data: 00 ff 00 ff 00 ff
CRC: 37581b7d
Does this mean for RRGGGBBB: 0xFFFFFF or the white color is treated as transparent and all other colors are as is? If so, for the general case, I need to construct an array of such color (say array of int) and during the decoding of the IDAT chunk, I need to look up if the color is one of the transparent color, if so, it is treated as (RRGGBBAA) 0xRRGGBB00, or fully transparent? What would be a good LUT for such case?
Thanks!