Skip to main content

[JAI-IMAGEIO] Specifying DPI upon JPEG-2000 enconding

1 reply [Last post]
Anonymous

Hi.

I am using the JPEG-2000 JAI Image I/O plugin writer in order to convert
some images to JPEG-2000 format.
Now I would like to be able to specify the default DPI of the encoded
JPEG-2000 image. I believe I have to play with Image metadata (IIOMetadata),
correct? The XML format of the metadata for the JPEG 2000 plugin can be
found on:

http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...
-fcs-docs/com/sun/media/imageio/plugins/jpeg2000/package-summary.html

Within the XML DTD, I've found the "JPEG2000CaptureResolutionBox" and the
"JPEG2000DefaultDisplayResolutionBox" XML elements, which probably would
allow me to specify the DPI of the encoded image. In particular, the
following XML elements should be of interest for this purpose:

Am I correct up to this point?

Now, where could I find some specific information about the exact meaning of
these XML elements? Do they specify the resolution in terms of pixel per mm,
pixel per cm, pixel per inch, or what other?

Apart from the unit, are the following assumptions correct?

VerticalResolution = (VerticalResolutionNumerator /
VerticalResolutionDenominator) ^ VerticalResolutionExponent;
HorizontalResolution = (HorizontalResolutionNumerator /
HorizontalResolutionDenominator) ^ HorizontalResolutionExponent;

Any help would be greatly appreciated.

Best regards,

Marco.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

On Mon, 8 Jan 2007, Marco Sambin - NeoLogica wrote:

> I am using the JPEG-2000 JAI Image I/O plugin writer in order to convert
> some images to JPEG-2000 format.
> Now I would like to be able to specify the default DPI of the encoded
> JPEG-2000 image. I believe I have to play with Image metadata (IIOMetadata),
> correct? The XML format of the metadata for the JPEG 2000 plugin can be
> found on:
>
> http://java.sun.com/products/java-media/jai/forDevelopers/jai-imageio-1_...
> -fcs-docs/com/sun/media/imageio/plugins/jpeg2000/package-summary.html
>
> Within the XML DTD, I've found the "JPEG2000CaptureResolutionBox" and the
> "JPEG2000DefaultDisplayResolutionBox" XML elements, which probably would
> allow me to specify the DPI of the encoded image. In particular, the
> following XML elements should be of interest for this purpose:
>
>
>
>
>
>
>
>
> Am I correct up to this point?

Yes.

> Now, where could I find some specific information about the exact meaning of
> these XML elements? Do they specify the resolution in terms of pixel per mm,
> pixel per cm, pixel per inch, or what other?

They are in "reference grid points per meter."

> Apart from the unit, are the following assumptions correct?

No, but close:

VerticalResolution =
(VerticalResolutionNumerator / VerticalResolutionDenominator) *
10 ^ VerticalResolutionExponent

and similarly for the horizontal component.

> VerticalResolution = (VerticalResolutionNumerator /
> VerticalResolutionDenominator) ^ VerticalResolutionExponent;
> HorizontalResolution = (HorizontalResolutionNumerator /
> HorizontalResolutionDenominator) ^ HorizontalResolutionExponent;
>
> Any help would be greatly appreciated.

If your have a source IIOMetadata object available and this object supports
the platform-neutral metadata format and contains a "Resolution" element
therein this should automatically be propagated to the Resolution box in the
JP2 output.

Brian

----------------
Brian Burkhalter
Java Media, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net