[gdal-dev] Multi-band JPEG2000 support?

Even Rouault even.rouault at spatialys.com
Wed Nov 26 13:20:01 PST 2014


Le mercredi 26 novembre 2014 22:08:43, jplacy2 a écrit :
> Thanks Even. Is it true that a recompile from source is necessary to
> support other drivers, namely the JasPer JP2 option? I haven't been able
> to find any windows binaries that make that driver available. But perhaps
> that option only supports three bands as well? I haven't been able to find
> a definitive answer.

Yes, you would need to convert from source. Jasper can create a 4-band 
JPEG2000, but the alpha band will not be tagged as such. And Jasper can have 
problems converting big images. But that should be OK for a 5920x7700 image.

Using OpenJPEG binaries might be easier.

> 
> Thanks again.
> 
> > On Nov 26, 2014, at 10:42 AM, Even Rouault-2 [via OSGeo.org]
> > <ml-node+s1560n5175106h69 at n6.nabble.com> wrote:
> > 
> > Le mercredi 26 novembre 2014 17:31:34, jplacy2 a écrit :
> > > Hi Folks-
> > > 
> > > I'm attempting to generate some 4-band JP2 files using the GDAL 1.11
> > > Win64 binary acquired from gisinternals.com.
> > > 
> > > I quickly ran into a problem... JP2 driver doesn't like four bands:
> > > 
> > > gdal_translate --debug on -of JP2OpenJPEG test.tif test.jp2
> > > GDAL: GDALOpen(test.tif, this=000000000061CB70) succeeds as GTiff.
> > > Input file size is 5920, 7700
> > > ERROR 6: Unable to export files with 4 bands
> > > GDAL: GDALClose(test.tif, this=000000000061CB70)
> > > 
> > > So my question is simple: what options are there for creating
> > > multi-band jpeg2000's with GDAL on the Windows platform?  I understand
> > > there are other driver options, but from what I have read, they all
> > > require a license and/or a recompile of GDAL from the source... the
> > > latter is not really in my skill set.
> > 
> > Jim,
> > 
> > This is known as http://trac.osgeo.org/gdal/ticket/5695. The restriction
> > has been put, because currently the driver couldn't not produce correct
> > RGBA files with the alpha band correctly marked as such. I may have the
> > opportunity to work on that in a medium term.
> > 
> > In the meantime, you could perhaps try the opj_compress utility of
> > openjpeg ( https://code.google.com/p/openjpeg/wiki/Downloads?tm=2 ), but
> > it will likely has the same flow as indicated above if you're interested
> > in RGBA images.
> > 
> > Even
> > 
> > > Thanks for any guidance,
> > > Jim
> 
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Multi-band-JPEG2000-support-tp5175104p
> 5175169.html Sent from the GDAL - Dev mailing list archive at Nabble.com.

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list