[Image-SIG] Question on TIFF EXTRASAMPLES tag support

Frank Warmerdam warmerdam at pobox.com
Wed Sep 10 16:16:35 EDT 2003


Tom Bridgman wrote:
...
> Apparently, this file has an incompatible 'EXTRASAMPLES'=1 flag but this
> appears to be indicating the presence of an alpha channel.  
> 
> After checking some additional references, I'm wondering what's the
> difference between the EXTRASAMPLES=1 and RGBA?  If there is no
> significant difference, couldn't support for this format be installed by
> just adding:
> 
>     (2, 1, (8,8,8,8), (1,)): ("RGBA", "RGBA"),
> 
> to the OPEN_INFO list in TiffImagePlugin.py?
> 
> Can anyone enlighten me?  
> 
> Should this be installed in the distribution?  
> 
> Other comments/suggestions?  I'm no expert on PIL - I'm making this
> determination based on one afternoon of study...

Tom,

extrasamples=1 is defined in the specification as being an associated alpha
data with pre-multiplied color components.  The text reads:

   This field must have a value of 1 (associated alpha data with pre-multiplied color
   components). The associated alpha data stored in component SamplesPerPixel-1
   of each pixel contains the opacity of that pixel, and the color information is pre-
   multiplied by alpha.

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.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Image-SIG mailing list