[gdal-dev] ALPHA and PHOTOMETRIC options in TIFF

Javier Jimenez Shaw j1 at jimenezshaw.com
Tue Jun 8 07:53:59 PDT 2021


Thanks Even

Doing that (multiband with minisblack and alpha), and interleave=band, when
computing overviews there is a problem. I opened an issue that explains it.
https://github.com/OSGeo/gdal/issues/3939
I tried a solution, but I think it is not the proper one.

Cheers.
Javier
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.



On Sat, 5 Jun 2021 at 10:30, Even Rouault <even.rouault at spatialys.com>
wrote:

> Javier,
>
> Le 05/06/2021 à 10:24, Javier Jimenez Shaw a écrit :
> > Hi
> >
> > I am struggling to save my data in (Geo)TIFF files with the proper
> > creation options.
> > My data is not standard RGB(A), but a collection of bands like red,
> > green, (not necessarily blue), another type of red, near infrared,
> > etc, and Alpha. It can be uint8, uint16 or float.
> >
> > I was using PHOTOMETRIC=MINISBLACK and ALPHA=YES, but now I am not
> > sure if this is the proper configuration. In addition to that, I am
> > setting a ColorInterpretation to the bands (many bands as
> > GCI_Undefined, like for Near Infrared. The alpha band is clear as
> > GCI_AlphaBand).
> This looks good. GDAL will potential write into its GDAL_METADATA XML
> tag custom band color interpretation if the very basic ones implied by
> only TIFF tags (Grey, Grey+Alpha, RGB, RGBA) don't fit your settings
> >
> > The "extra samples" is obscure to me, I do not know how many bands
> > expects, and how many are "extra".
> > (https://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html
> > <https://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html>)
> You shouldn't worry too much about that tag. The GeoTIFF driver will
> take care of setting it. But basically if you use
> Photometric=MinIsBlack, then count(extra_samples) = number_bands - 1, or
> if you use Photometric=RGB, count(extra_samples) = number_bands - 3.
> >
> > TIFF says "There is no default for PhotometricInterpretation, and it
> > is required. Do not rely on applications defaulting to what you want."
> > in
> >
> https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html
> > <
> https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html
> >
> >
> > How should I create my TIFFs?
>
> For what you describe, MinIsBlack is the appropriate Photometric value
>
> Even
>
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210608/d8a01f0c/attachment.html>


More information about the gdal-dev mailing list