openjpeg icon indicating copy to clipboard operation
openjpeg copied to clipboard

Writing of Resolution Information to the Capture Resolution Box

Open IanHendersonTNA opened this issue 9 years ago • 6 comments

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.

IanHendersonTNA avatar Jun 02 '16 10:06 IanHendersonTNA

The ability to read this info would help as well. See https://github.com/ruven/iipsrv/issues/191#issuecomment-587432030

zabak avatar Feb 18 '20 23:02 zabak

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.

stweil avatar Nov 18 '20 07:11 stweil

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.

callegar avatar Dec 11 '20 12:12 callegar

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.

callegar avatar Dec 11 '20 12:12 callegar

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.

stweil avatar Dec 05 '21 11:12 stweil

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.

stweil avatar Dec 10 '21 11:12 stweil