
And then you look at the finished product and ... yuk! A faint border is visible around the image, and the two colors just don't match. That's impossible! You used the exact same hexadecimal code. What went wrong?
When you optimized your image for the web, you saved it as a JPG file. JPG compression is "lossy" - meaning that some of the purity of the color is lost and "noise" is introduced into the image. That is why some of the aqua pixels inside your logo image changed color. The "lossy" nature of JPG compression also blurs crisp edges.
If you want the background color of an image to blend seamlessly with the background color of a webpage, you must do two things. First, make sure you do create the background color of the image with the exact same 6-digit hexadecimal code that you have specified for your webpage background color. Secondly, you must optimize the original image using GIF compression. GIF compression is "lossless" - the color in the image retains the exact color you specified. Just make sure the Lossy value is set to its default of 0 (zero) on the "Save for Web" window in Adobe Photoshop,
This same solution applies if you want the background of an image to blend seamlessly with the background of other media, such as a Microsoft PowerPoint slide. For a more detailed discussion of the topic, see our tutorial Optimizing Web Graphics in Photoshop. If you need to learn the difference between JPG and GIF formats, check out All About JPG and GIF.
► Take a look at some of our other interesting posts, such as Easy Way to Create GIF Transparency in Photoshop