[gdal-dev] [GDAL-dev] convert rgba alpha layer to rgb white

Pierre CARREAUD pierre.carreaud at sites.fr
Wed Feb 5 09:19:31 PST 2014


Hi list,

I’m trying to assembly some RGBA tiff in one with gdalbuildvrt and then to
translate them to a RGB TIFF tiled file YCBCR jpeg compressed.

No problem
 But now, I would like to get a white color in the background
instead of the black.

 

The following commands work but I get nodata (and so, black) on any white
pixels whereas I just wanted to convert alpha to white
 The problem in on
the vrt.

 

gdalbuildvrt assembly.vrt -srcnodata b4 –hidenodata -vrtnodata 255 *.tif

gdal_translate -of GTIFF -b 1 -b 2 -b 3 -co COMPRESS=JPEG -co
JPEG_QUALITY=95 -co TFW=YES -co BIGTIFF=YES -co ALPHA=NO -co TILED=YES -co
PHOTOMETRIC=YCBCR -co PROFILE=BASELINE assembly.vrt assembly_JPG.tif

gdaladdo -r gauss -ro --config COMPRESS_OVERVIEW JPEG --config
JPEG_QUALITY_OVERVIEW 95 --config BIGTIFF_OVERVIEW YES --config
PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL --config
NODATA_VALUES 255 assembly_JPG.tif 2 4 8 16 32 64 128 256

 

Do you have an idea? The problem is the is not –init option, just -vrtnodata
“255 255 255” to fix both background color but also the nodata bandper band


 

Pierre CARREAUD

Spécialiste en imagerie numérique

 


carte_voeux_2014

L’INGÉNIERIE DE LA DURABILITÉ

 

SITES – Entité Île-de-France

Division du Développement Technique

2 bis avenue du Centre

92500 Rueil-Malmaison, France

Tel : 01 41 39 02 00 / Fax : 01 41 39 02 01

 <http://www.sites.fr/> www.sites.fr

 

CARRES  EXPERTISE  cid:image002.jpg at 01CB7A74.CDE1E680  INSTRUMENTATION /
MESURES  cid:image002.jpg at 01CB7A74.CDE1E680  INGENIERIE

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140205/44da2e8f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 6152 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140205/44da2e8f/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 717 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140205/44da2e8f/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 632 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140205/44da2e8f/attachment-0002.jpg>


More information about the gdal-dev mailing list