[gdal-dev] tiff with colortable loses alpha values?

Vincent Schut schut at sarvision.nl
Wed Sep 29 05:02:55 EDT 2010


  On 09/28/2010 07:29 PM, Even Rouault wrote:
> Vincent,
>
> The TIFF format doesn't allow storing the alpha component, so it is ignored.
>
> See the TIFF specification, section 5 :
> http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
>
> Possible workarounds :
> * work with RGBA tiff
> * add a mask band
>
> Best regards,
>
> Even
Even,

thanks for the info. I already was afraid it wouldn't...
I'll go and write 4band rgba tiffs directly, then.

Best,
Vincent.
> Le mardi 28 septembre 2010 16:24:18, Vincent Schut a écrit :
>>    Hi,
>>
>> I'm creating a geotiff with colortable using the python bindings,
>> however, the alpha value of the colorentry is lost / always set to 255
>> (says gdalinfo on the output image).
>> Does gdal/geotiff with colortable not support rbga?
>> Or, what am I doing wrong?
>>
>> Testcase is below:
>>
>>
>> from osgeo import gdal
>> gtiff = gdal.GetDriverByName('GTiff')
>> ds = gtiff.Create('/home/vincent/test.tif', 1, 1, 1, gdal.GDT_Byte)
>> ct = gdal.ColorTable()
>> ct.SetColorEntry(1, (100, 100, 100, 100))
>> ds.GetRasterBand(1).SetColorTable(ct)
>>
>> gdalinfo on /home/vincent/test.tif says 100,100,100,255 for colorentry 1...
>>
>> using gdal from svn, internal geotiff.
>>
>> Regards,
>> Vincent.
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list