[Gdal-dev] GeoJP2K: Unable to view 16-bit data

Frank Warmerdam warmerdam at pobox.com
Fri Apr 30 17:05:42 EDT 2004


Valentine Anantharaj wrote:
> Greetings!
> 
> I am unable to view some16-bit GeoJP2K files, created using GDAL w/ 
> Kakadu support.  The viewer window was simply blcak.  I tried them using 
> both 'kdu_show' and the MSI viewer as well as their ArcView plug-ins.  I 
> also got similar results (everything just black) from the '16-bit 
> comparison' samples from:
> 
>    ftp://ftp.remotesensing.org/jpeg2000/16bitcomparison
> 
> The 8-bit, 3 channel RGB files display fine in both kdu_show and MSI 
> viewer.  Any recommendation for viewing 16-bit GeoJP2K files?  I do not 
> have the necessary patches/sevice-packs/modules for ENVI 4.0 or IMAGINE 
> 8.6.

VGA,

I believe the problem is that these 16 bit files have a relatively small
small dynamic range.  Kdu_show just divides 16bit values by 256 to get
an 8bit value for display purposes.  So a 16bit file with values going from
0 to 1000 would end up being scaled to roughly 0-4 out of 256.

If you want to generate a 16bit file that is viewable with kdu_show, I think
scaling it to the full range would help. For instance, the following would
scale input 8bit data to 16 byte data stretching the range 0 to 255 to
0 to 65535.

eg.

gdal_translate -of JP2KAK -scale 0 255 0 65535 -ot UInt16 utm.tif out.tif

My opinion is that kdu_show (and the MSI viewer) are just not well suited
to remotely sensed 16 bit data which often has a limited dynamic range related
to the values that come from the original sensor.

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




More information about the Gdal-dev mailing list