JPEG2000 formats

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
A.K.
Posts: 6
Joined: 2014-10-28T07:52:51-07:00
Authentication code: 6789

JPEG2000 formats

Post by A.K. »

In the page http://www.imagemagick.org/script/formats.php I find the following tags, related to JPEG2000:
JP2 JPT J2C J2K.
I do not find JPC in this list.

As far as I understand, the above four tags are at the same time file extensions, and I can simply
convert file.dcm file.j2k
to get a JPEG2000 CodeStream.

But this does not work:
convert.im6: unable to encode image file `IM.j2k' @ error/jp2.c/WriteJP2Image/1140.

("does not work" assumes "Version: ImageMagick 6.7.7-10 2014-03-06 Q16", Ubuntu)

Instead,
convert file.dcm file.jpc
works fine.

Could somebody clarify this?
Last edited by A.K. on 2014-11-02T23:06:22-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 formats

Post by fmw42 »

6.7.7-10
This is an ancient version of IM (about 120 versions old). IM has since upgraded JP2 processing from using the Jasper delegate library to the OpenJpeg 2.1 library. Many enhancement have been achieved by the upgrade. Jasper was limited to only a few formats.

You should upgrade and see if that helps.
A.K.
Posts: 6
Joined: 2014-10-28T07:52:51-07:00
Authentication code: 6789

Re: JPEG2000 formats

Post by A.K. »

I have tryed upgrade, and, it seems, succesfully:
Now I have "Version: ImageMagick 6.7.7-10 2014-03-06 Q16"

Nothing changed.

May be I was not clear enough in my first post: I have no conversion problems (abd I had no need to upgrade).
I simply wanted to note:
(1) J2K is mentioned in the list of formats, but conversion to *.j2k does not work.
(2) JPC is NOT mentioned in the list of formats, but conversion to *.jpc does work.

So, it looks like a bug, or inaccuracy in the format_list_HTML_page (or I misunderstood something).

None of J2K, JP2, JPC is returned by identify -list format
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 formats

Post by fmw42 »

6.7.7-10
That is the same version you had before. Try upgrading to IM 6.8.9.10
A.K.
Posts: 6
Joined: 2014-10-28T07:52:51-07:00
Authentication code: 6789

Re: JPEG2000 formats

Post by A.K. »

A.K. wrote:I have tried upgrade, and, it seems, succesfully:
Now I have "Version: ImageMagick 6.7.7-10 2014-03-06 Q16"
Sorry, I am not an expert in "upgrading" (as well as in Linux), I did upgrade following IM instructions for installing from source (including, as far as I remember, .config, make, install, etc)
My obvious error --- I have reproduced the output of convert -version, instead of /usr/local/bin/convert -version.
The latter yields 6.8.9-10. And does not perform some conversions
(in particular, convert: no encode delegate for this image format `DCM' @ error/constitute.c/WriteImage/1167).

As mentioned above, I have no problems with ImageMagick conversions.
Possibly, the above mentioned features are corrected in recent versions (I cannot verify) --- that's OK.
Possibly, they are not considered by IM team as bugs or inaccuracies, and therefore need not be corrected.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: JPEG2000 formats

Post by fmw42 »

When you upgrade IM, you need to install all the delegate libraries you will need for image formats and other things.

If you can upload an image of the format/suffix in question to some free hosting service such as dropbox.com and post the URL here, we can test that format against the current IM and let you know if that is supported or if it can be added if not supported. It depends upon what formats OpenJpeg 2.1 supports.
Post Reply