[gdal-dev] GDAL alpha channels
Even Rouault
even.rouault at mines-paris.org
Mon Jul 2 15:19:54 PDT 2012
Le mercredi 30 mai 2012 22:26:18, Craig Bruce a écrit :
> Even Rouault <even.rouault at mines-paris.org> wrote:
> > There will be likely a compatibility problem if we do this, because
> > GDAL up to now writes TIFF RGBA images with EXTRASAMPLE_ASSOCALPHA
> > (pre-multiplied), but I think in most cases the data that people have
> > feed in the GTiff driver was not pre-multiplied. So if we un-premultiply
> > this would cause issues in case the alpha value is not 0 or 255.
>
> You only need to deal with altering the raw data on reading if the GTiff
> driver were changed to always write unassociated alphas. Also, if people
> have been writing non-pre-multipled samples to associated-alpha files in
> the existing interface, then the TIFF data is damaged in any case.
>
> > The temporary conclusion of that is that there are likely images in
> > the wild where the value of the flag does not reflect the reality
> > of the imagery values... But, GDAL should likely be fixed to set
> > EXTRASAMPLE_UNASSALPHA to better reflect the way it is generally used
> > (presumably).
>
> There's not much you can do about damaged images in the wild. However,
> we can try to prevent more from being created.
This is just what I've done in trunk. See
http://trac.osgeo.org/gdal/ticket/4733 for the details.
Best regards,
Even
More information about the gdal-dev
mailing list