Skip to main content

Accessing all resolutions in a JPEG2000 image

1 reply [Last post]
Joined: 2003-08-24


Does this bug mean that it's impossible to access all resolutions inside a JPEG2000 image?

For example if I open a JPEG2000 image in Photoshop it asks me which resolution I'd like to open it in: 1280x1024, 640x512, 320x256, 160x128, 80x64, or 40x32

Is it possible to:

1) Find out what resolutions exist?
2) Open an arbitrary resolution on demand?

The obvious benefit here is that I could get at a reduced-size resolution without having to scale the image.

Thank you,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-08-24

I managed to access all resolutions using J2KImageReadParam.setResolution() and, ImageReadParam) but in the process I found a bug in the documentation of J2KImageReadParam:

The documentation for "resolution" reads "If the given index is greater than the number of available resolution levels of the compressed image, the decoded image has the lowest available resolution (among all tile-components)". In fact, it has been my experience that if the given index is larger than the maximum then the resulting resolution will be the largest, not the smallest as the documentation leads one to believe. I can't file a bug report because I don't (yet) have observer permission on the JAI-ImageIO project.

I have one last outstanding question: is there a way to find out the resolution of each "level" without decoding the entire image? The downside of the above approach is that, ImageReadParam) decodes the entire image and only finds out the resolution of the level after the fact. There should be a cheaper way to do this.