[Image-SIG] Re: Question on TIFF EXTRASAMPLES tag support

Fredrik Lundh fredrik at pythonware.com
Fri Sep 26 10:00:15 EDT 2003


Tom Bridgman wrote:

> > I gather this means that the RGB color values have already been multiplied
> > with the alpha value before storing in the file though this seems a bit
> > weird to me.
> >
> > The specification is at:
> >    ftp://ftp.remotesensing.org/pub/libtiff/TIFF6.pdf
> >
> > Page 77 is what I was looking at. There is lots more discussion.
> >
>
> This makes sense for some types of compositing.
>
> Reading this, it looks like the flag is set more as information to any
> software that reads the file and does additional processing - the image
> data itself is unaffected.

no, the RGB data has been premultiplied with the alpha value; to
get the original RGB value, you have to divide each of red, green,
and blue with the corresponding alpha value.

(see page 31 in the TIFF spec for some more info)

your patch is correct only if "A in (0, 255)" is true for the entire
image.

(I'll see if I can do something about this in 1.1.5).

cheers /F






More information about the Image-SIG mailing list