[Gdal-dev] RE: Strange NoData value from a MrSID image (Peng Gao)

Peng Gao pgao at esri.com
Thu Jun 30 11:36:06 EDT 2005


> -----Original Message-----
> From: Michael P. Gerlek [mailto:mpg at lizardtech.com]
> Sent: Friday, June 24, 2005 11:43 AM
> To: warmerdam at pobox.com; Peng Gao
> Cc: gdal-dev at xserve.flids.com
> Subject: RE: [Gdal-dev] RE: Strange NoData value from a MrSID
> image (Peng Gao)
>
> Frank, Peng:
>
> In the MrSID SDK, we are not band-specific -- that is, a
> pixel is considered nodata iff all bands match the given values.
>
> -mpg
>
>
> -----Original Message-----
> From: Frank Warmerdam [mailto:fwarmerdam at gmail.com]
> Sent: Friday, June 24, 2005 10:57 AM
> To: Peng Gao
> Cc: Michael P. Gerlek; gdal-dev at xserve.flids.com
> Subject: Re: [Gdal-dev] RE: Strange NoData value from a MrSID
> image (Peng Gao)
>
>
> On 6/24/05, Peng Gao <pgao at esri.com> wrote:
> > I have a question about the interpretation of MrSID NoData value.
> > Is a pixel considered NoData only if all three values match their
> > corresponding band NoData value, or Is a pixel considered NoData if
> > any band value matches band NoData value? For example, given NoData
> > values (0, 0, 0), Are only those pixels with value (0, 0, 0)
> > considered NoData, or (0, x, x), (0, 0, x), and etc considered as
> > NoData pixels as well?
>
> Peng,
>
> In the GDAL data model, nodata is band specific.  So if band
> one has a nodata value of 0, then that band is considered to
> be nodata if the pixel value is zero.  A pixel might well be
> no data in some bands, and not in others ... at least in theory.
>
> I'm not sure if this is the normal interpretation in MrSID though.
>

I have a case where MrSID SDK reports NoData values (0, 0, 0) for
3 bands, and I have a MrSID image containing black text with value 
(0, 13, 14).  Since GDAL uses band specific NoData interpretation, 
the band 1 is nodata. My app considers a
multiband pixel NoData if any of the band is nodata. As the result,
the black text is displayed transparent.
I could ignore
MrSID NoData color at application level. But I can't handle the case
where the NoData values come from PAM.

One solution could be not using native MrSID NoData color as GDAL band
specific 
NoData value (because it's not), and adding a new call at Dataset level
to 
get NoData color for the entire dataset for apps that want to make 
use of the NoData color?

What do you think?

Gao, Peng



More information about the Gdal-dev mailing list