No noticeable difference in density?

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
pinoguin
Posts: 7
Joined: 2011-03-15T08:01:04-07:00
Authentication code: 8675308
Location: Philippines

No noticeable difference in density?

Post by pinoguin »

Hi,

I have a task to convert images to 300dpi or higher and set to cmyk for print.

So far after reading up I've come up with this command:

Code: Select all

convert stock1.jpg -density 300 -units PixelsPerInch -quality 100 -profile EuroscaleCoated.icc cmyk_stock1.jpg
The colors have downgraded as expected so I assume the cmyk job is done(I hope Euroscalecoated is the norm for cmyk (??)...), but when playing around with the -density the image never really changes... I've set it to 1 but don't see any difference. Am I doing this right?

Image

There seems to be a large amount of detail lost here... even at a higher density...

Removing the density option gives me a dpi of 96... Using 'identify' command I could not see any lines with dpi, so I assumed it was 'resolution'
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: No noticeable difference in density?

Post by anthony »

First of all the color change is not because you canged any of the pixels, You just told what ever program is displaying that it should use that profile to interprete the colors.

To convert a image values using profiles, you need TWO profiles. If the input image does not have a profile, you need to supply one.

See Color Profile Basics
http://www.imagemagick.org/Usage/formats/#color_profile

Second setting a -density does just that, sets the density. Again it does not modify an image as -density is just a setting, not an operator. To change the scale of an image so the 'real world' size remains the same you with resize it relating it its density or resolution. That is done using -resample {new_density}. Of course like profile that assumes you have the correct density set already!

See Denisty
http://www.imagemagick.org/Usage/basics/#density
and Resampling
http://www.imagemagick.org/Usage/resize/#resample
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
pinoguin
Posts: 7
Joined: 2011-03-15T08:01:04-07:00
Authentication code: 8675308
Location: Philippines

Re: No noticeable difference in density?

Post by pinoguin »

Thanks for the info, I tried resampling and found some improvement:
Image

Code: Select all

convert -resample 500 boy.jpg -units PixelsPerInch -quality 100 -profile EuroscaleCoated.icc cmyk_boy.jpg
But I still notice the cmyk image seems a little soft, is this a normal behavior of IM or am I missing something? I could probably resample it a bit more higher but then that would make the file very huge. I only wanted to convert this small image to cmyk without losing it's sharpness. I tested this on bigger files however and didn't notice any quality downgrade, it seems to only affect small - less than 15kb images... maybe that's a normal issue when converting to cmyk?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: No noticeable difference in density?

Post by fmw42 »

You are going from jpg to jpg. That will cause loss of quality even with -quality 100 unless you are using lossless .jp2 (JP2000 from the Jasper delegate)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: No noticeable difference in density?

Post by anthony »

pinoguin wrote:

Code: Select all

convert -resample 500 boy.jpg -units PixelsPerInch -quality 100 -profile EuroscaleCoated.icc cmyk_boy.jpg
Put the -resample between the input and the output! IM does things in the order you specify. In IM v7 why you gave would probably be a syntax error!

Second. Does the input image have a colorprofile? If not, you need to have at least two -profile settings to specify the input color profile.
Alternatively remove all color profiles first, specify the input profile, then the output profile.

Code: Select all

convert boy.jpg   -units PixelsPerInch -resample 500 \
          +profile icc +profile icm -profile sRGB.icc -profile EuroscaleCoated.icc \
          -quality 100 cmyk_boy.jpg
See Color Profile handling
http://www.imagemagick.org/Usage/formats/#profiles
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply