Convert to J2C from DPX

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
churchwa
Posts: 4
Joined: 2017-02-22T16:50:12-07:00
Authentication code: 1151

Convert to J2C from DPX

Post by churchwa » 2017-02-22T16:54:19-07:00

I am trying to batch convert DPX>J2C and am having a few issues.

The main one being that IM keeps making the J2C file using the JP2 codec. i.e. it produces a file called test.j2c but when you try and open it the software says this is a JP2 file and not a J2C.

How can a force IM to convert to a J2C file?

User avatar
fmw42
Posts: 22091
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Convert to J2C from DPX

Post by fmw42 » 2017-02-22T19:33:26-07:00

Assuming you are using a more current version of IM and openjpeg 2.1 or higher in your IM compile, then try prefacing your output with J2C:output.j2c

Also see http://www.imagemagick.org/script/jp2.php

churchwa
Posts: 4
Joined: 2017-02-22T16:50:12-07:00
Authentication code: 1151

Re: Convert to J2C from DPX

Post by churchwa » 2017-02-23T09:25:10-07:00

Thanks for the advice although I still get the same result using J2C:file.j2c

As a noob, can I ask. Having installed the latest version of IM can I assume the latest openjpeg is installed as well? (Using windows)

CMD gives me the following message after converting the file (regardless if I use the prefix or not):
convert: Deprecated fields cp_cinema or cp_rsiz are used
Please consider using only the rsiz field
See openjpeg.h documentation for more details
`OpenJP2' @ warning/jp2.c/JP2WarningHandler/236.

User avatar
fmw42
Posts: 22091
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Convert to J2C from DPX

Post by fmw42 » 2017-02-23T10:20:54-07:00

Sorry I do not know about that.

What do you get from

Code: Select all

convert -version
Does it include JP2?

What version of openjpeg do you have on your system? You can find that from

Code: Select all

convert -list format
Perhaps it is a limitation of Imagick. Does it work fine using the command line in a terminal or PHP exec() command?

User avatar
fmw42
Posts: 22091
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Convert to J2C from DPX

Post by fmw42 » 2017-02-23T10:56:40-07:00


User avatar
fmw42
Posts: 22091
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Convert to J2C from DPX

Post by fmw42 » 2017-02-23T10:58:38-07:00

Is there really a difference? Do you know of openjpeg supports j2c?

churchwa
Posts: 4
Joined: 2017-02-22T16:50:12-07:00
Authentication code: 1151

Re: Convert to J2C from DPX

Post by churchwa » 2017-02-23T13:23:59-07:00

So convert -version gives:
Version: ImageMagick 7.0.5-0 Q16 x64 2017-02-20 http://www.imagemagick.org

And J2C is in the list of formats with the module being JP2. Seems I have version 2.1.2 of openjpeg.

I have tried both convert and magick as convert is now deprecated, and get the same output.

churchwa
Posts: 4
Joined: 2017-02-22T16:50:12-07:00
Authentication code: 1151

Re: Convert to J2C from DPX

Post by churchwa » 2017-02-23T13:26:22-07:00

fmw42 wrote:
2017-02-23T10:20:54-07:00

Perhaps it is a limitation of Imagick. Does it work fine using the command line in a terminal or PHP exec() command?
I am running it all from command line.

We are feeding in approx 50meg 4K files and the subsequent j2c files are only 1.2meg.
Does this sound right, seems very small.

I have done -quality 0 for lossless and the resolution comes out at 4k which is also correct.

User avatar
fmw42
Posts: 22091
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Convert to J2C from DPX

Post by fmw42 » 2017-02-23T15:19:58-07:00

Sorry, I do not know the difference between JP2 and J2C. I could not find on Google any document that explained the difference other than suffix.

Post Reply