Page 1 of 1

Color-Problem when converting

Posted: 2014-08-06T01:34:28-07:00
by modads
Hi there,

i use jmagic to resize user-uploaded images on a web page.
Here i have some image, which are not be able to show correctly in firefox.
For them i tried to do a conversion, but i can't get it working. I even try some icc color profiles.

Maybe someone have an idea a) how to detect such images and b) how to convert it correctly.

Here one of the images:
http://www.imgbox.de/show/img/LcdFDmdNdT.jpg

> the colors are wrong in firefox, ie handle it fin, my image viewer (irfanview) also.


Code looks similar to: (i try all adobe icc profiles, because i expected one of them, but no success):

Code: Select all

...
                ImageInfo origInfo = new ImageInfo(); //load image info
                MagickImage image = new MagickImage(origInfo, data); //load image

                image.setColorProfile(new ProfileInfo(filename, iccProfile));
                image.rgbTransformImage(ColorspaceType.RGBColorspace);

...
thanks a lot

Re: Color-Problem when converting

Posted: 2014-08-06T07:43:58-07:00
by snibgo
"identify" shows that your image is CMYK. Computer screens are red, green and blue. Perhaps different software converts differently. I suggest that you use sRGB for consistency across browsers.

Re: Color-Problem when converting

Posted: 2014-08-06T07:57:41-07:00
by modads
I don't have any choice which images the users upload.
I have to support such images, so (and that is the question of this topic): how to i convert such images, with correct colors?

Re: Color-Problem when converting

Posted: 2014-08-06T08:03:20-07:00
by snibgo
This image doesn't have an embedded profile, so you can only guess at the correct method of converting to sRGB.

The simplest method is "-colorspace sRGB".

A more complex method is to assign one of the CMYK profiles, and convert to one of the sRGB profiles, for example:

Code: Select all

-profile USWebCoatedSWOP.icc -profile sRGB.icc

Re: Color-Problem when converting

Posted: 2014-08-06T23:31:09-07:00
by modads
snibgo wrote: A more complex method is to assign one of the CMYK profiles, and convert to one of the sRGB profiles, for example:

Code: Select all

-profile USWebCoatedSWOP.icc -profile sRGB.icc
Have i any chance to get (maybe only the name) of the used color profile?

Re: Color-Problem when converting

Posted: 2014-08-07T09:42:04-07:00
by fmw42
If you are on a current version of IM, see the string formats at http://www.imagemagick.org/script/escape.php

%[profile:icc] ICC profile info
%[profile:icm] ICM profile info
%[profiles] list of any embedded profiles

convert image -format "%[profiles]" info:
or
identify -format "%[profiles]" yourimage

otherwise, you will need to parse that from identify -verbose yourimage