Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color differences between images and html

I'm having issues with color matching css background colors with colors in images on the same html page. What gives?

like image 840
Hafthor Avatar asked Sep 30 '08 19:09

Hafthor


4 Answers

I'm guessing that you use a PNG image? This is a gamma correction “feature”. Mark Ransom has posted a useful text about this.

Notice that the pngcrush solution listed somewhere hasn't worked for me.

like image 90
Konrad Rudolph Avatar answered Oct 26 '22 05:10

Konrad Rudolph


What image editing program are you using? I found this article about Photoshop color profiles. There can also be issues with PNG gamma correction.

like image 26
Chris Marasti-Georg Avatar answered Oct 26 '22 04:10

Chris Marasti-Georg


Could be due to the browser's colour management.

like image 26
moonshadow Avatar answered Oct 26 '22 04:10

moonshadow


It might be a color profile issue.

For instance, if the image is a JPEG and has a color profile and your browser doesn't support displaying images in the color profiles that they specify, the colors of the image itself will render differently in your browser. In this situation, if you checked the color of the image in Photoshop (color profile aware) and then applied that color in your CSS and viewed the page in a browser that is not color profile aware, it would look different.

like image 33
Joe Lencioni Avatar answered Oct 26 '22 04:10

Joe Lencioni