[Gdal-dev] transparent Geotiff?

Ken Boss Ken.Boss at dnr.state.mn.us
Fri May 27 10:35:13 EDT 2005


Bart--

If your goal is simply to set background to transparent in mapserver apps, you should be able to use the OFFSITE parameter in your layer definition to accomplish that - no conversion necessary.  Eg:,

  LAYER
    NAME shr30im3
    STATUS OFF
    DATA "data/gen/state/mn/shdr_clrim3.tif"
    TYPE RASTER
    OFFSITE 255 255 255
  END # shaded relief

HTH,

--Ken

>>> "Bart van den Eijnden" <BEN at Syncera-ITSolutions.NL> 05/27/05 9:21 AM >>>
Worked like a charm! Opens up transparent in OpenEV now so I am sure Mapserver will do the same. Thanks a lot!

D:\wormerland\new>gdalwarp -dstalpha -srcnodata 255 -dstnodata 0 de_poel.tif de_poel2.tif
Creating output file that is 9384P x 6340L.
ERROR 6: SetColorInterpretation() not supported for this dataset.
:0...10...20...30...40...50...60...70...80...90...100 - done.

Best regards,
Bart

Bart van den Eijnden
Syncera-ITSolutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl 

>>> Eric Sokolowsky <eric.sokolowsky at gsfc.nasa.gov> 05/27/05 04:12pm >>>
On Fri, 27 May 2005, Bart van den Eijnden wrote:

> Hi list,
>
> I have a lot of geotiff files which have a white background. Because many of the tiffs overlap, I need a way to create transparent tiffs (set white as the transparency color). Does anybody know how to do this?

You can try using the gdalwarp tool to convert from your source image to
a new image with transparency with the -dstalpha switch.  You probably also
need -srcnodata 255 and -dstnodata 0.  The the help for gdalwarp for more info.

-- 
     ____   __     Eric Sokolowsky    (GST)  NASA Goddard Space Flight Center
    / __/__/_/__  Visualization Programmer    Scientific Visualization Studio
   / __/ _/ / _/ 301.286.3751                  Mailstop 610.3 Bldg 28 Rm E102
  /___/_//_/__/ eric.sokolowsky at gsfc.nasa.gov   Greenbelt, MD 20771

_______________________________________________
Gdal-dev mailing list
Gdal-dev at xserve.flids.com 
http://xserve.flids.com/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list