uclouvain / openjpeg

Official repository of the OpenJPEG project
Other
976 stars 456 forks source link

Support for encoding multi-channel images for instance multi-spectral data #1391

Open giacomomarchioro opened 2 years ago

giacomomarchioro commented 2 years ago

Dear all, thanks for this library, I am using it in a no-profit project for multi-spectral digitalization of manuscripts.

In literature I have found different implementations of JPEG2000 applied to multi-spectral encoding of data, I could not find a way to use openjpeg to achieve this goal I was wondering if this feature is already implemented or is planned to be?

Best regards, Giacomo

lidq92 commented 5 days ago

@giacomomarchioro https://gdal.org/en/latest/drivers/raster/jp2openjpeg.html GDAL's JP2OpenJPEG Driver can handle multispectral image compression.

giacomomarchioro commented 4 days ago

@lidq92 hanks a lot, I have to investigate further! it seems based on OpenJPEG library v2 I don't understand how it can create multi-band images while OpenJPEG can't. I have to try, did you manage to create a multiband image could you share your procedure?

lidq92 commented 4 days ago

Source code: https://github.com/OSGeo/gdal/tree/master/frmts/openjpeg

Given a q, run gdal_translate -of JP2OpenJPEG -co QUALITY=q tif_path jp2_path if lossless mode, further add -co REVERSIBLE=YES

You can have a look at the doc for more create options.

giacomomarchioro commented 4 days ago

@lidq92 thanks a lot for sharing I'll have a look