Page 1 of 1

Is is possible to get jpeg2000 from ImageToBlob?

Posted: 2014-02-10T10:39:51-07:00
by robertraiz
Hello all,
I have a script which takes png8/32 files and crops them to a fixed width and height and then uses ImageToBlob.
The problem is that I would need to get and end result with a jp2 file as I get a smaller size of the same file.

Is it possbile to use ImageToBlob(magick=>'jp2')? I tried but with no luck.

Re: Is is possible to get jpeg2000 from ImageToBlob?

Posted: 2014-02-11T03:25:39-07:00
by robertraiz
If this is not possible I would also need some insight in how to make my png8 files smaller...maybe? The only attribute that I am sending to ImageToBlob is magick -> png and quality-> 90
I am not sure if I could use some compression or something similar.

I appreciate any advice.

Re: Is is possible to get jpeg2000 from ImageToBlob?

Posted: 2014-03-14T02:26:46-07:00
by robertraiz
Hello,
I am still trying to use:

Code: Select all

 ImageToBlob(magick=>'jp2')
but with no luck.

I have a png file and I want to obtain the jpeg 2000 format from the script.
The error is an empty file."

Can someone please tell me how is the correct syntax that should be used?

Re: Is is possible to get jpeg2000 from ImageToBlob?

Posted: 2014-03-14T04:58:57-07:00
by magick
Type
  • convert -list format
Is JP2 listed as supported?
  • JP2* JP2 rw- JPEG-2000 File Format Syntax (2.0.0)
If so, ImageMagick can read and write JPEG2000 images, including with ImageToBlob().

Re: Is is possible to get jpeg2000 from ImageToBlob?

Posted: 2014-03-14T05:55:15-07:00
by robertraiz
Hello,

I think you have solved my issue. I do not have the format listed.
I will try to install the support.

The thing is, that equery u shows that the support for jpeg 2000 is active. (through DCM* maybe )

Re: Is is possible to get jpeg2000 from ImageToBlob?

Posted: 2014-03-14T07:08:32-07:00
by robertraiz
Unfortunately I did not manage to install the support for it.

if I run indentify on my jp2 image, I get:

Code: Select all

test.jp2 PNG 300x300 3000x3000+600+900 8-bit sRGB 6.69KB 0.000u 0:00.000
I just ran

Code: Select all

convert test.png test.jp2
Is it possible the conversion is not ok?