Re: Hex Color Shifting

by jdowdell(at)macromedia.com (John Dowdell)

 Date:  Fri, 11 Jun 1999 12:14:53 -0700
 To:  hwg-graphics(at)hwg.org
  todo: View Thread, Original
At 3:15 PM 6/10/99, Chris Hawkins wrote:
>What is happening is that the saved jpgs (50% compression) are shifting the
>color by 1, or now 103-204-255, which of course shows slightly lighter and
>obvious against the background of 102-204-255.  Is this inevitable with
>compression?

Yes, JPEG files can shift color. They're not lossless like GIF.

Still, it can be hard to match a foreground GIF color to a background HTML
color in all browsers... particularly at some color depths, some browsers
may round colors differently.

When people wish to make images appear to merge smoothly into the page's
background, then there are two techniques I've seen in common use:

--  Using a tiling GIF/JPEG background in the page... this will have the
same type of color shift as the foreground GIF/JPEG. (In other words, we're
avoiding matching IMG colors to HTML colors, and are instead laying one
image atop another image.)

--  Matte a background-trasparent GIF to the general background color of
the HTML page. This "breaks the box" of the rectangular image, and small
color shifts won't really be visible with the antialiased pixel matte
around the edge.
    (Detail: Make the GIF's background color the same HEX value as the
destination HTML color, so that the foreground art antialiases to this
color, and then turn that background color transparent... the result will
be that your artwork appears to antialias to something very close to the
HTML color.)

jd





John Dowdell, Macromedia Tech Support, San Francisco CA US
Search technotes: http://www.macromedia.com/support/search/
Offlist email risks capture by the spam filters. I may not see your
email if it's not on the list. Private one-on-one email options are
available via Priority Access: http://www.macromedia.com/support/

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA