Colors off

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
riegel
Posts: 26
Joined: 2003-08-19T12:36:46-07:00
Location: Rocky Mount, NC 27804
Contact:

Colors off

Post by riegel » 2006-09-20T09:44:24-07:00

There seems to be some color shifts going on. What I'm doing is giving a photo a border, rotating it slightly and then assigning a background color to match the background color of the page.

There are times the background matches and other times it doesn't.

You can see what I'm talking about at: www.youbelong.net/thebrowns

Click on Journal and look at the thumbnail photos that run down the page, then click on a couple of the other journal entries and you will see the shift in colors.

Any help would be appreciated.

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

Post by magick » 2006-09-20T11:12:57-07:00

Are your original images in RGB or CMYK? Converting from CMYK to RGB requires two color profiles (i.e. USSwop and sRGB). Otherwise with image rotation there is a slight blending of colors but no shift should be apparent. A path forward would be to post a URL to a before and after picture that illustrates the problem and the exact command you use to create the after picture. We need to reproduce the problem before we can comment further.

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony » 2006-09-20T21:34:06-07:00

If you are saving to GIF, the color shift may also be a quantization fault..

See IM Examples on quantization (and one solution I haven't finished working on)
http://www.cit.gu.edu.au/~anthony/imagi ... _not_exact

However after looking at your page I see you use a JPEG, though with my FireFox browser I don't see any color shifts with the few angled photo images I looked at.

More than likely what is happening is broswer specific. Some browsers will dither JPEG images to a reduced color map (web-safe coloring) This may be the reason for a visible color shift. It could also be as chrisy states, some color profile changes.

I do not think the cause is the 'lossy' nature of JPEG handling, though that is also a posibility.

I suggest you get a couple of other sorts of web browsers, IE, FireFox, Opera, etc.. and just take a look to see if the color shift changes from one browser to another.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

riegel
Posts: 26
Joined: 2003-08-19T12:36:46-07:00
Location: Rocky Mount, NC 27804
Contact:

Post by riegel » 2006-09-21T03:23:57-07:00

It could also be as chrisy states, some color profile changes.
I suggest you get a couple of other sorts of web browsers, IE, FireFox, Opera, etc.. and just take a look to see if the color shift changes from one browser to another.


Thanks for your reply. You are correct, I do not see the color shift in Firefox, but I do see the color shift with Safari. I would suspect it is a color profile issue.

This image exhibits the problem. If you look at the pixel in the top-right of the image it should be #d1ceb8, but it is #d1cfb7 (according to Photoshop)

http://www.youbelong.net/sites/thebrown ... -3440.jpeg

How would I strip the color profile that may be causing the problem?

Below is the exact code that is causing the problem.
  • -geometry [x]x[y]
    -bordercolor white
    -border 10
    -bordercolor grey50
    -border 1
    \( +clone
    -background black
    -shadow 60x2+2+2 \)
    +swap
    -background "#d1ceb8"
    -flatten
    -rotate [rotate]
    -geometry [x]x[y]

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony » 2006-09-21T18:42:51-07:00

This image exhibits the problem. If you look at the pixel in the top-right of the image it should be #d1ceb8, but it is #d1cfb7 (according to Photoshop)

Such a minor pixel difference will not be visible, and will be caused purely by the JPEG lossy format. Ignore it, it is not the problem.

Also rotations should be done before shadowing, or your shadow also gets rotated, though with such small rotations this should not be a big problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

riegel
Posts: 26
Joined: 2003-08-19T12:36:46-07:00
Location: Rocky Mount, NC 27804
Contact:

Post by riegel » 2006-09-22T03:54:07-07:00

anthony wrote: Such a minor pixel difference will not be visible, and will be caused purely by the JPEG lossy format. Ignore it, it is not the problem.

Also rotations should be done before shadowing, or your shadow also gets rotated, though with such small rotations this should not be a big problem.


I have to disagree. It is noticable. There is no problem with Firefox, but there is with Safari. My guess is that Safari is honoring the color profile, and Firefox is ignoring it. I tried to use the -strip command but it doesn't seem to actually strip the profile.

riegel
Posts: 26
Joined: 2003-08-19T12:36:46-07:00
Location: Rocky Mount, NC 27804
Contact:

Post by riegel » 2006-09-23T17:58:57-07:00

Yes, I tried that as advised earlier.

Post Reply