openjpeg
openjpeg copied to clipboard
Writing of Resolution Information to the Capture Resolution Box
This to request the ability to write correct Pixels Per Meter/ Pixels Per Inch image resolution information to the ResolutionBox upon generation of JP2 from TIF source files. This should be to the 'Capture Resolution Box'' as standard but capacity to also write to the Display Box might be an additional enhancement.
The ability to read this info would help as well. See https://github.com/ruven/iipsrv/issues/191#issuecomment-587432030
Are there already plans to add the missing information, or is anybody working on this four year old issue?
I just noticed that .jp2 files generated by opj_compress don't include the image resolution (which is expected by Tesseract for example) while kdu_compress writes that information.
The feature is essential for image digitisation in libraries which want to use JPEG 2000 for long term preservation.
This is actually quite important for making good PDFs out of scanned images. Because for some reason in most linux distros image editors (imagemagick, gimp, etc.) are unable to write jpeg 2000 files, the only way to make such files to be passed to img2pdf is with opj_compress. If opj_compress gets the resolution wrong, for the same reason it is not possible to correct it later.
Incidentally, even before getting the ability to read the resolution information from the input file, please allow the user to specify the resolution on the command line.
Are there already plans to add the missing information, or is anybody working on this four year old issue?
The issue is now five years old, and I just noticed that the resolution information is still missing in JP2 files created by opj_compress. Is there still nobody working on an implementation? If no, I might try it.
Some documentation for the Resolution box and the Capture Resolution box is available here.
See also issue #378.
My current implementation is in branch https://github.com/stweil/openjpeg/tree/resolution. It can already read the resolution of TIFF files and adds that information to opj_image, but still has to pass it to opj_jp2_t and implement opj_jp2_write_res. As soon as this is done, it should be possible to convert a TIFF to JPEG 2000 while preserving the resolution information.