tiff to jpeg2000 dpi problem

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
placebo

tiff to jpeg2000 dpi problem

Post by placebo » 2010-03-18T14:49:39-07:00

I want to convert a 300dpi tiff to a 150dpi jpeg2000

Code: Select all

convert source.tif -resample 150x150 destination.jp2
everything goes ok, but when I open the image with irfanview the resolution field is blank so the print size is wrong. If I use -density 150x150 nothing changes. What can I do to make the image display the correct dpi value?

User avatar
fmw42
Posts: 25275
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff to jpeg2000 dpi problem

Post by fmw42 » 2010-03-18T15:15:29-07:00

perhaps you need to specify a value for -units.

Also do you want the image size in pixels to change. If not, then -resample is not what you want. You would need just -density.

Best if you post a link to your image, so others can inspect and test with it.

placebo

Re: tiff to jpeg2000 dpi problem

Post by placebo » 2010-03-18T16:07:41-07:00

using -units PixelsPerInch didn't change anything.

-density changes only the attribute of the image, and that's what I tried to change after resampling the image in order to get the dpi display right. But for some reason when converting an image to jpeg2000 loses that attribute and using density doesn't fix it.
I can't upload an image, but you can test it with any image, it's not a problem with a specific image.

User avatar
fmw42
Posts: 25275
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff to jpeg2000 dpi problem

Post by fmw42 » 2010-03-18T16:26:09-07:00

I probably cannot help much further, except to ask whether you have the Jasper library installed (correctly).

convert -list configure

DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr openexr png tiff x11 xml zlib

placebo

Re: tiff to jpeg2000 dpi problem

Post by placebo » 2010-03-19T01:21:54-07:00

it looks installed correctly

Code: Select all

C:\>convert -list configure

Path: [built-in]

Name          Value
-------------------------------------------------------------------------------
NAME          ImageMagick

Path: C:\Program Files\ImageMagick-6.6.0-Q16\configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            vs8
COPYRIGHT     Copyright (C) 1999-2010 ImageMagick Studio LLC
DELEGATES     bzlib freetype jpeg [b]jp2[/b] lcms png tiff x11 xml wmf zlib
HOST          windows-unknown-linux-gnu
LIB_VERSION   0x660
LIB_VERSION_NUMBER 6,6,0,7
NAME          ImageMagick
RELEASE_DATE  2010-03-15
VERSION       6.6.0
WEBSITE       http://www.imagemagick.org

Path: configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            vs8
COPYRIGHT     Copyright (C) 1999-2010 ImageMagick Studio LLC
DELEGATES     bzlib freetype jpeg [b]jp2[/b] lcms png tiff x11 xml wmf zlib
HOST          windows-unknown-linux-gnu
LIB_VERSION   0x660
LIB_VERSION_NUMBER 6,6,0,7
NAME          ImageMagick
RELEASE_DATE  2010-03-15
VERSION       6.6.0
WEBSITE       http://www.imagemagick.org
it seems that converting an image to jpeg2000 makes it lose it's dpi attribute, can someone else please test this to check if I am doing something wrong?

User avatar
fmw42
Posts: 25275
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff to jpeg2000 dpi problem

Post by fmw42 » 2010-03-19T11:53:16-07:00

Yes, I would agree this appears to be a bug and should be reported to the bugs forum.


Testing IM 6.6.0-7 Q16 Mac OSX Tiger

convert logo: -density 72 -units PixelsPerInch logo.tif
identify -verbose logo.tif
Image: logo.tif
Format: TIFF (Tagged Image File Format)
Class: PseudoClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: PixelsPerInch


convert logo.tif logo.jp2
identify -verbose logo.jp2
Image: logo.jp2
Format: JP2 (JPEG-2000 File Format Syntax)
Class: DirectClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined

User avatar
magick
Site Admin
Posts: 11018
Joined: 2003-05-31T11:32:55-07:00

Re: tiff to jpeg2000 dpi problem

Post by magick » 2010-03-19T12:58:06-07:00

We use the Jasper delegate library to save images in the JPEG 2000 format. We are not aware of any method that Jasper exports where we can set the image resolution units. If you find a way, let us know, otherwise your bug report should go to the folks that support the Jasper delegate library.

Post Reply