[mapserver-users] OFFSITE for RGB images with GDAL

Pushkar Pradhan pushkar at ERC.MsState.Edu
Tue Apr 16 18:11:15 EDT 2002


Frank,
I am also wanting to do the same thing:
- i've erdas img. files, I want to set to x'parent the black sides of the
image
doing OFFSITE 0 doesn't work in the layer object.
>From your email I understand that to set x'parency options on 24bit images
you must have tiffs/pngs that too which have alpha channels, right?
I have erdas .img files and need to choose from the various bands which 3
to load (this has been done by using modified code of mapserver from
stepan kapka).
This means I've to do a "hack" in mapraster.c as you suggest?
Thanks.

> Simpson, Andrew wrote:
> > What value should be used for the OFFSITE parameter when displaying
> > 24bit RGB images?
> >
> >
> >
> > 0,0,0 is the color I would like to make transparent.
> >
>
> Andrew,
>
> Unfortunately, it does not currently appear to be possible to utilize the
> OFFSITE capability with RGB (24bit) GDAL images in MapServer.  However, the
> GDAL code does support alpha bands, so if you can produce PNG or TIFF files
> with an Alpha layer, and set the alpha to 0 for areas you want to be
> transparent, and if you ensure the files are treated by GDAL (not the builtin
> PNG or TIFF drivers) then you can get transparency.
>
> Of course, if you are bold you can easily hack the inner RGB loop to do what
> you want in drawGDAL() in mapraster.c.
>
> Best regards,
>
> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>

-Pushkar S. Pradhan





More information about the mapserver-users mailing list