On vendredi 24 mars 2017 13:36:35 CET Rahkonen Jukka (MML) wrote: > Hi, > > I am following the FAQ "How to create or modify an image color table?" from > https://trac.osgeo.org/gdal/wiki/FAQRaster > > I took out the palette from existing tiff file into VRT and I would like to > change alpha value of the first input from 255 into 0. > > I had originally this: > > <VRTDataset rasterXSize="734" rasterYSize="565"> > <VRTRasterBand dataType="Byte" band="1"> > <ColorInterp>Palette</ColorInterp> > <ColorTable> > <Entry c1="255" c2="255" c3="255" c4="255" /> > <Entry c1="0" c2="0" c3="0" c4="255" /> > ... > Then I edited the VRT into > > <ColorTable> > <Entry c1="60" c2="255" c3="255" c4="0" /> > <Entry c1="0" c2="0" c3="0" c4="255" /> > ... > > > Then I executed > gdal_translate fixed_palette.vrt fixed palette.tif > > However, the result is not exactly what I hoped for: > > Band 1 Block=734x11 Type=Byte, ColorInterp=Palette > Color Table (RGB with 256 entries) > 0: 60,255,255,255 > 1: 0,0,0,255 > > The value "60" for the red band is taken from my edited palette but my > edited alpha value is not honored. Am I doing something wrong?
No, this is a TIFF limitation. The format doesn't support the alpha component in color tables. You might workaround this by setting the NODATA value to 0 instead. > > -Jukka Rahkonen- -- Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
