geotiff.js icon indicating copy to clipboard operation
geotiff.js copied to clipboard

readRGB returns 3-channel data even for transparent images?

Open jnpatrick99 opened this issue 4 years ago • 1 comments

So readRasters returns transparent data in case of RGBA images. But readRGB always returns 3 channels right? How do I get transparency mask in that case (for example I'm reading transparent CMYK and RGB files that then project to HTML Canvas that is always RGBA). Thanks!

jnpatrick99 avatar Apr 12 '22 19:04 jnpatrick99

Hi @jnpatrick99 As far as I understand, CMYK and RGB do not provide an alpha (transparency) channel. You have to specify an offsite color, one color that you manually render as transparent.

readRGB does read 4-channel, when the underlying chromatic representation allows for it, which is currently just RGBA.

constantinius avatar Apr 13 '22 11:04 constantinius