colorspace change causes heavy pixelation

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
blahor

colorspace change causes heavy pixelation

Post by blahor »

hi everyone!

i'm in the need of an automated colorspace conversion for jpeg images (from rgb to cmyk) and tried to do it with:

Code: Select all

convert foo.jpg -colorspace cmyk -quality 100 bar.jpg
unfortunately the resulting bar.jpg is awfully pixelated. if i don't change the colorspace the image degredation isn't noticeable at all so i guess it has something to do with the colorspace change. photoshop can do it fine so IM has to be able to do it either.

what can i do avoid the pixelation or am i doing something wrong?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: colorspace change causes heavy pixelation

Post by anthony »

See profile and changing colorspace, in IM examples
http://www.imagemagick.org/Usage/formats/#colorspace
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
blahor

Re: colorspace change causes heavy pixelation

Post by blahor »

thx for pointing me in the right direction, unfortunately i still can't get it working.

i've downloaded adobe's free icc profiles and tried to convert to cmyk with:

Code: Select all

convert foo.jpg +profile icm -profile EuroscaleUncoated.icc bar.jpg
and

Code: Select all

convert foo.jpg -profile EuroscaleUncoated.icc bar.jpg
both resulting in an image with invalid icc profile and still rgb. help appreciated...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: colorspace change causes heavy pixelation

Post by anthony »

your need three profile options! remove, input and output!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
blahor

Re: colorspace change causes heavy pixelation

Post by blahor »

alright, got it finally working with the -profile option:

Code: Select all

convert foo.jpg +profile icm -profile AdobeRGB1998.icc -profile USWebCoatedSWOP.icc -quality 100 bar.jpg
thx. unfortunately the resulting image quality is still pretty bad. the colors are better but it's still pixelated.

here's an example of the results:

original rgb: http://fraglab.at/tmp/big_0.jpg

photoshop: http://fraglab.at/tmp/big_0_ps.jpg

IM with above command: http://fraglab.at/tmp/big_0_im.jpg


there's got to be a better way...
blahor

Re: colorspace change causes heavy pixelation

Post by blahor »

seems like i've taken exactly the 'right' picture for the test. works much better with other pictures. no noticeable loss of quality at all.

what's the reason for the different results? profile of the src image?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: colorspace change causes heavy pixelation

Post by anthony »

Or just a bad picture. Prehaps a posting of the image so we can see the pixeliation.
I don't think I can do anything about it, but others may be able to. Prehaps in a new subject
"what is wrong with this CYMK picture?"
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply