[gdal-dev] Cannot set transparent color for GeoTIFFs

Chaitanya kumar CH chaitanya.ch at gmail.com
Mon Feb 8 07:59:20 EST 2010


Ralf,

Your tif files seem to use color tables. You may be able to edit the color
table to represent RGBA instead of RGB with A value set to 0 for nodata and
1 elsewhere. I don't know much about handling the color tables.

If you don't want to deal color tables, use the -expand option in
gdal_translate.
First use "-expand rgb" to create RBG tiffs. Then use gdalbuildvrt with
-srcnodata and -addalpha options. Finally, convert it All.tif using
gdal_translate.

On Mon, Feb 8, 2010 at 5:43 PM, Ralf Wagner <rpw at globema.pl> wrote:

> Unfortunately I have absolutely no idea how to deal with this transparency
> problem - all my trials failed.
> I am experimenting on four properly referenced GeoTiff, overlapping files
> with white margins.
> My (temporary) goal was to obtain ONE GeoTIFF file from these FOUR source
> files - but, of course, without white margins between them.
> So, first I created VRT file from my source GeoTiffs:
>
> gdalbuildvrt -srcnodata "255 255 255" All.vrt Ac3.tif Ac4.tif Ca1.tif
> Ca2.tif
>
> and then GeoTiff from this VRT file:
>
> gdal_translate -of GTiff All.vrt All.tif
>
> But white stripes still existed. Also, additional step of creating separate
> VRT files for each GeoTiff file and using these files as components for
> "All.vrt" didn't help. Messing around with -vrtnodata, -hidenodata etc.
> didn't help also. Using -addalpha option causes warning during destination
> GeoTiff file generation: "Unable to export color table to GeoTIFF file" and
> resulting file is broken.
>
> So, I am stuck...
>
> Do you have any idea what can I try next?
>
> Best regards,
> Ralf Wagner
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9848167848
17.241582N 80.142635E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100208/b19ff647/attachment-0001.html


More information about the gdal-dev mailing list