[Gdal-dev] Re: Q. Strange colors produced in output image (jpeg to NITF w/ IC=C8)

Frank Warmerdam warmerdam at pobox.com
Thu Apr 19 14:20:08 EDT 2007


David, Bradley J. wrote:
> I am trying to produce NITF 2.1 images with JPEG 2000 compression,
> however I keep getting strange results in the final image.  I am using
> OpenEV_FW to view my images.  Here's my code and images:

David,

I just tried converting an RGB jpeg image to NITF/JPEG2000 with this
command:

gdal_translate -of NITF -co IC=C8 -co IREP=RGB in.jpg out.ntf

And the resulting image displayed properly in OpenEV.  In my case the
JP2ECW driver seems to have been used to do the encoding.  Perhaps you
could run with debug enabled (add  CPLSetConfigOption("CPL_DEBUG","ON");)
and verify that the JP2ECW driver is being used.  You should see something
like:

   ECW: Writing with PROJ=RAW, DATUM=RAW

You should also do a gdalinfo on the output file and verify that the colors
are reported as RGB, not YCbCr.  If the colors are off it is almost certainly
because the RGB image is converted to YCbCr in the jpeg2000 data stream and
then not converted back properly.  Whether this happens or not may depend on
which jpeg2000 driver gets used for the encoding and/or the decoding.

Once you have narrowed things down somewhat, could you please file a bug
report in the GDAL Trac with the details.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list