Mark Janssen

Navigation

Skip navigation.

Search

Site navigation

Email conversation

This follows on from previous emails from Mark, but begins a new subject, so I am starting a new page.

FromMark Janssen
ToMe
SubjectInternet Explorer Alpha PNG
Date1 January 2004 13:50
Hi,

I have some big trouble with IE Alpha PNG.
The PNG images get darker than JPEG files (or jpeg gets lighter?), as you
can see on the screenshot. Of course, in mozilla, everything shows up
fine. Can you help to get IE render the images correct?

I use PNG and JPEG to reduce size: I made 375kb to just 109kb.
The image is created and sliced using Adobe Photoshop CS and Adobe 
ImageReady CS.

Thanks for your help and a happy 2004.

Kind regards,

Mark Janssen
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 15:19
Seen this many times, and unfortunately without knowing how to fix it. 

There are two causes of this problem:

The first problem is that Internet Explorer almost never displays the
colours you tell it to (in much the same way as Netscape 4 never makes a
frame the size you tell it to), even with truecolor displays. Instead it
dithers colours to approximate their value, and it never gets it quite
right. If the background color was one of Internet Explorer's native
colors, like pure white for example, you would not see any problem.

The second problem is that PNG graphics contain gamma correction 
information, and Internet Explorer abuses that information. It applies it
even to transparent parts of the image, and of course, it does not apply
it to the background image, so you see a mismatch. Good browsers like
Opera, Gecko and KHTML do this properly.

As for your particular example though, you are doing something a little
odd (although fixing what you have done still does not fix the colour
shade problem):
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='04.jpg');
Why are you loading a jpg image with the alpha image loader? There is no
need to use the alpha loader trick with a jpg image - it has no alpha
anyway!

What I suggest you do is create the whole background using segments 
of jpg images, then overlay JUST the words as an alpha png image over the
top of the jpg background. That way, the alpha works just fine. Would this
do what you need?

Tarquin
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 15:35
AttachmentImage showing the desired behaviour:
The image is a planet. The glow around the outside should be transparent (using PNGs).
The main part of the planet uses JPEGs to reduce file size. In IE, the colours on the PNGs and JPEGs do not match (the PNGs are always darker).
Hi,

Why I load the jpg with the alpha loader was to check if that'd solve the
problem :). But it didn't. http://xxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxx.xxx/
The alpha is only the outer layer: it has a glow. The inside is made JPEG
to save webspace, bandwidth and time. The background are the stars, the
planet are images placed over the background.

I attached a screenshot with a good explaination of the images.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 16:02
I get what you are doing. Nice effect by the way.

Can you remove gamma correction using photoshop? or set it to 1 for all
colour chanels (so saying no correction)?

If not, I cannot see any easy way to do what you want if you use jpegs.
You could use GIFs (ask me how to if you want ...), but I think that will
make a much bigger file size again, so you might as well use pngs.

What happens if you decrease the number of colours to 256? does the 
image still look ok, and does the file size as a png become acceptible? I
think the transparent parts would still need to be full colour, as
otherwise you can't use alpha.

You could still put the words over the top as a transparent png if you
want more colours ...

As a separate point, you are going to have problems with jpegs anyway,
because the artifacts of lossy compression become visible along the edges.
Normally this does not matter because people don't use much compression,
and they don't split images into pieces. Because you are splitting the
image into pieces then putting them beside each other, people will be able
to see the edges of the images.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 16:14
I have another idea. Could you put a transparent png (use binary 
transparency - and try stretching a 1px by 1px 2 colour png) over the top
of the jpegs. Does the gamma correction from the png affect the underlying
jpegs?
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 17:03
> Can you remove gamma correction using photoshop? or set it to 1 for all 
> colour chanels (so saying no correction)?

Not that I know of.

> What happens if you decrease the number of colours to 256?

Using PNG-8 or GIF 128 Dithered creates a good image, but makes the 
image from 16 to 54 kb. PNG-8 is 48kb. Tested with the image where the 
text is on.

> As a separate point, you are going to have problems with jpegs anyway, 
> people will be able to see the edges of the images.

http://xxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxx.xxx/
Do you see any edges?

> I have another idea. Could you put a transparent png over the 
> top of the jpegs.

How can I do so?
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 17:25
> Do you see any edges?

Only because I am looking for them ;)

I can see the line between the two jpegs, but I suppose normal viewers
won't even notice ... Photoshop has got some pretty good compression
algorithms!

> > I have another idea. Could you put a transparent png over the
> > top of the jpegs.

> How can I do so?

You need to do this, not me, because I don't have photoshop, or your
personal gamma correction.

Create a new png image 1px by 1px. Decrease the number of colours to two
(these will usually default to black and white). Assuming the image is
currently white, set the colour white to be transparent (like you would
with a GIF image - if you have any problems with this, create a GIF image
and make it transparent, then re-save it as a png). Save the image without
any alpha.

Now put that image in a positioned element, over the top of the jpeg
image, and make its height and width attributes the same as the jpeg
image. As it is transparent, other browsers will simply show the jpeg
image through it, IE just might apply the gamma correction and fix it's
own problem, but I don't suspect that this will work very well. But it is
worth trying just in case it does work.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 17:56
OK, I have another idea:

As internet explorer is the only one getting it wrong, why not prepare
special pngs for IE that are brightened just the right amount so that they
match the jpegs. You can then use these in the alpha image loaders instead
of the normal alpha images.

hehe. - might work

would mean a bit more for it to download though, but it is misbehaving, so
I don't care!
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date1 January 2004 20:06
> > Do you see any edges?

> Only because I am looking for them ;)

OK, I can't see them.

> Could you put a transparent png over the top of the jpegs.

And...what is the html for it?!?

> why not prepare special pngs for IE that are brightened just the right
> amount so that they match the jpegs.

I could also replace the JPEGs by PNGs, for IE?

But hey, as you can see on my screenshot, it makes the JPEG lighter and
not the PNG darker, so something is wrong with the JPEG. Is there any
gamma correction for JPEGs?

Not sure, but the JPEGs are 26kb and the PNGs 84kb.
It would mean redownloading of the JPEGs to PNG if I use javascript, I
could also use server-side replacement.

Could you look into this javascript file:
[a script that replaces all png images with spans using alphaimageloader
to load the png as their background]
It doesn't seem to work...
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 10:10
> But hey, as you can see on my screenshot, it makes the JPEG
> lighter and not the PNG darker, so something is wrong with the
> JPEG. Is there any gamma correction for JPEGs?

The JPEG format does not support gamma correction. This is just 
because IE approximates colours (surprise: IE is not perfect ... ;)

The alpha image loader may be getting things right because it is a 
directx plugin, not the IE core renderer.

> > Now put that image in a positioned element, over the top of the jpeg 

> And...what is the html for it?!?

<div style="position: absolute; right: 0; top: 0; z-index: 2;">
<img src="fix.png" width="668" height="155">
</div>

This would cover the first image, you would need to 
do the same again with the second (top, height and 
width adjusted of course).

> I could also replace the JPEGs by PNGs, for IE?

yes, this script would work (put it just before the </body> tag):
<!--[if gte IE 5.5]>
<script>
for(var x=0;document.images[x];x++){
var im = document.images[x];
if(im.src.match(/0[24]\.jpg$/)) {
im.src=im.src.replace(/\.jpg/,'.png');
} }
</script>
<![endif]-->

with any luck, this script would also abort the 
loading of the unrequired images, so they would 
only have to load the pngs, not the jpegs as well.

I'm still working on your script for you - give me 
a while.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 10:34
Attachmentsa simplified version of the script
I have attached your script with loads of updates. read my comments in the
script file; they will tell you how to fix the problem.
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 12:00
Thanks for the script.
I'm going to test it after I have eaten something ;).

I in fact got the file from

[some other site]

And it works there :S...
Anyway, does your javascript replace the images before the png fix 
script runs? Or should I merge those two?
I have bad experiences with javascripts that are not executed OnLoad...

Regards,

Mark
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 12:55
The transparent-png-over-jpeg doesnt work.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 13:06
You should run either one or the other, not both.
[Ed. Wrong! both were needed - corrected later]
Just remember that one
replaces the jpegs with regular PNGs (the one that runs just before the
</body> tag), and the other loads PNGs with alpha (the external script
file you sent). As those particular PNGs don't need alpha, either will
work properly.

Oh cr*p. I've just realised how they do that alpha opacity. It works on
any absolutely positioned element, but works on normal elements too, if
they have width and height explicitly set. Sh*t! I'm going to have to
update my alpha page.
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 13:07
> You should run either one or the other, not both.

OK understand.

> I'm going to have to update my alpha page.

So...does the script have to be edited/optimized?
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 13:30
> So...does the script have to be edited/optimized?

no, both scripts should work as they are (of yourse, your page needs to
use [if gte ie5.5] not [if gte 75.000] ... ;)
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 14:03
i done that to test if the script was causing problems ;)
lets hope IE 75 uses the gecko engine :D

Can I merge them in any way, the image will be on every page so it needs
to load the javascript every time? I made: i--
      }
       }
   for(var x=0;document.images[x];x++){
var im = document.images[x];
if(im.src.match(/0[24]\.jpg$/)) {
im.src=im.src.replace(/\.jpg/,'.png');
} }
    }
window.attachEvent("onload", correctPNG);

and..how can I use opacity in opera? I want to make a menu-div which is
white-transparent. Or should I trick the background images by creating a
50% white on which I place as div-background?

mark

ps. script still not working ...
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 15:08
Ok, my mistake;
var imgStyle += img.style.cssText
should be
var imgStyle = img.style.cssText

> how can I use opacity in opera?

with difficulty. You cannot make the whole menu div transparent, 
because Opera does not support any kind of alpha on arbirary 
elements, only on images.

To do the effect you want, use an alpha transparent image on the 
background of the menu divs. You can also use the alpha loader for IE.

As for using both scripts, yes, they need to be merged, but they need to
be merged carefully. I have attached a version that will also convert the
jpgs into a loaded png (you need to create those pngs).


As a different but very important note, the way you have structured your
page is very poor. I assume you were going to do this later, but I will
give you some pointers. It only works at certain resolutions. This is
because the images are all in a single line, and they rely on the page
size to force linebreaks at the right times. I suggest this structure:

<div>
<nobr><img ...><img src="blah.jpg"></nobr><br>
<nobr><img ...><img src="blah.jpg"></nobr><br>
<nobr><img ...><img ...></nobr>
</div>
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 16:17
> var imgStyle += img.style.cssText
> should be
> var imgStyle = img.style.cssText

OK thanks...but it still doesn't work.
Note that the text isn't visible in IE either...

> To do the effect you want, use an alpha transparent image on the 
> background of the menu divs. You can also use the alpha loader for IE.

How can I use the alpha loader for background images?!

> <nobr><img ...><img src="blah.jpg"></nobr><br>

How can I get that valid XHTML 1.1?

I know about the poor coding, but I don't want to use tables!
Do you know why divs with a negative z-index aren't rendered?
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 20:38
> OK thanks...but it still doesn't work.

Dude, your page works here ... ;)
IE 5.5

> > To do the effect you want, use an alpha transparent image on the
> > background of the menu divs. You can also use the alpha loader for IE.

> How can I use the alpha loader for background images?!

<style>
div.menu { background-image: url(blah.png); }
</style>
<!--[if gte ie5.5]>
<style>
/* be more specific here to override the other one */
body div.menu { background-image: none;
  /* line truncated for email, you need to put in the full line */
  filter:progid:DXI.......AlphaImageLoader(src='varyAlpha.png');
}
</style>
<[endif]-->

> > <nobr><img ...><img src="blah.jpg"></nobr><br>

> How can I get that valid XHTML 1.1?

img tags must become:
<img src="" ... />
<br> tags must become
<br />

nobr is NOT valid HTML or XHTML. use <span style="white-space:nowrap;">

> I know about the poor coding, but I don't want to use tables!
> Do you know why divs with a negative z-index aren't rendered?

What I gave you will not need tables. The nowrap and BRs force table-like
response.

Negative z-index should not be possible, but browsers may interpret it as
0, in which case other things may be stacked in front of it, OR, browsers
may incorrectly accept the negative value, and put it behind the document
(which is at z-index: 0;) so it would be invisible.
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 21:06
Attachmentscreenshot showing a page with all images invisible
> Dude, your page works here ... ;)
> IE 5.5

Look at the shot.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 21:47
> Look at the shot.

ok, your browser is having problems, cos I just tried it again in IE5.5,
and it works just fine.
If you set tools - internet options - advanced - 'display a notification
about every script error'
do you get any errors when you load the page?
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date2 January 2004 21:59
No.
Mozilla gives me:

Error: window.attachEvent is not a function
Source File: http://deeppurple.europe.webmatrixhosting.net/js/correctpng.js
Line: 56

(I removed the if gte tag)
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date3 January 2004 13:24
I saw that you removed the conditional comment, so Mozilla would give 
an error. As for IE, I have no idea why it is not working. sorry. Mine 
works, ao I assume you have a problem with your installation (I may be 
wrong though ...)
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date3 January 2004 14:58
Could you give me a screenshot of your IE?
And, is there any method in IE to list the images on a page?

mark
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date3 January 2004 19:05
AttachmentScreenshot showing the effect working properly in Internet Explorer 5.5
> Could you give me a screenshot of your IE?

attached

> And, is there any method in IE to list the images on a page?

Not for what you want. You can use script to show what images are on 
the page by saving the script as a javascript bookmarklet, but as your 
images have been turned into spans, that will show nothing.

try this instead:

once the page has loaded (or failed to load in your case), type the 
following into the address field and press enter:
javascript:alert(document.body.innerHTML)

This will tell you the HTML that your page body is now constructed 
using. It should contain all of the spans that have been created.
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date3 January 2004 22:14
javascript:alert(document.body.innerHTML) gives me an empty alert...

strange that it does work at your place.
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date3 January 2004 23:37
OK, your's is screwed.

it should at least alert '<div style="blah"></div>'

Honestly not sure how to do anything more with it. Looks like a browser 
bug.
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date5 January 2004 23:40
How can I make a fade-effect in opera? I think I can't right?

regards, mark
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date5 January 2004 23:23
> How can I make a fade-effect in opera? I think I can't right?

Opera cannot do fade-ins, because it doesn't support opacity
....
but
....
There is a trick you can use with alpha for background fades;
create a PNG with an alpha fade, fully opaque on the left, fully 
transparent on the right. Set that image as the background for a div, at 
position 0,0, no-repeat. Now, use JavaScript to move the background 
position slowly left. Whatever is behind the div will slowly fade into view. 

To be honest though, there are very few places where this effect would 
be of any use, but it's nice to know that it is possible ...

Note also that Safari (1.1 on OS X 10.3+) can also do fade-ins, using a 
slightly messy syntax (note, alpha filter must have been set INLINE):

function setAlpha(oV,oID) {
var oD = document.getElementById(oID);
// IE
if( oD.filters ) { oD.filters.alpha.opacity = oV * 100; }
// Mozilla Gecko
oD.style.MozOpacity = oV;
// Safari 1.1
if( oD.style.setProperty ) { oD.style.setProperty('-khtml-opacity',''+oV+'',null); }
// and just in case anyone starts supporting it ...
oD.style.opacity = oV;
}
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 13:37
OK, thank you.
I believe this is a nice effect, but I want something that hides a dive
including text, so fade out; if you check the URL I also gave you I want to
fade out the div instead of hiding it instantly. I think I can't...

What about making a div cover the whole document, with an alpha png as
background?


Mark Janssen
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 13:52
You can fade only a background, not the text on it, so fading from one set
of text to another is virtually impossible. You can fade one div (including
its text) to blank, then from blank to the other div, but not directly from
one div to the other.
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 13:56
Well I meant to fade out a div, incl. contents. If fact you can crossfade:
fade out one, and start fading in the other one at the same time...
 
What about making a div cover the whole document, with an alpha png as
background?..how can I?

Mark Janssen
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 15:24
> In fact you can crossfade:
> fade out one, and start fading in the other one at the same time

not in Opera. You would have to fade one out, then hide the upper div of
text, then fade the new one in.
 
> What about making a div cover the whole document, with an alpha png
> as background?..how can I?

create a png image, that is stupidly wide (10'000 pixels wide should be
ok) but only 1 pixel high.
make the left 2000 pixels fully transparent
make the right 2000 pixels fully opaque
fade the pixels in between from fully transparent on the left to fully
opaque on the right

use
<div id="myDiv" style="
visibility: hidden;
background: transparent url(myPNG.png) repeat-y scroll 0 0;
">

then do this:

function doFade() {
var theDiv = document.getElementById('myDiv');
theDiv.style.visibility = 'visible';
window.posNow = 0;
window.fdDv = setInterval('mvBG();',50);
}
function mvBG() {
var theDiv = document.getElementById('myDiv');
theDiv.style.backgroundPosition = '0px '+posNow+'px';
if( posNow == 8000 ) {
  clearInterval(fdDv);
}
posNow+=100;
}
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 17:58
I can place the div over the document in IE?! 


Mark Janssen
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 19:10
I meant I _can't_. 

Mark Janssen
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 21:36
Attachmentsan ugly version that works in Opera
a beautiful version that does not work in Opera
I just tried it. Opera refuses to apply the alpha background properly. It
works in Mozilla, so I know it's right, it's just that Opera will not
correctly apply alpha to a background like that.

So, I tried another idea (not a very good one ... but it works, even if it
is a bit ugly - it probably is not good enough for what you need). Put the
upper content in a hidden div, with a transparent background. Put the
lower content as part of the main page. It must be _ALL_ the same color,
which is why I don't think it is much good.

When you want to fade, make the upper div visible. Now fade the body
background color to match the color of the text of the lower content (the
upper content color must strongly contrast). Honestly, the effect is not
very good, it just illustrates a point.

I suggest you don't bother fading in Opera!

I have attached two scripts - one that does the fade properly, but not in
Opera (reverts to simple showing and hiding), and one that does the fade
(very) badly, but works in Opera.

Note that to achieve total body coverage, you need 100% height, 100%
width, and this has its own problems, see:
http://www.quirksmode.org/index.html?/css/100percheight.html
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 22:15
Thanks!
This is exactly what I'm looking for (the 2nd fading). Now...lets find out
how you did the 100%x100% div in IE (as that was the only browser with a
100%x100% bug!)


Mark Janssen
FromMark Janssen
ToMe
SubjectRe: Internet Explorer Alpha PNG
Date6 January 2004 22:23
AttachmentPage showing IE not applying translucent background image
OK, I tried some stuff. I set a background image (png with alpha) to
create the same effect.
The problem now is:
* IE doesn't show the background image
* Mozilla fades slow

See the attachments for details.


Mark Janssen
FromMe
ToMark Janssen
SubjectRe: Internet Explorer Alpha PNG
Date7 January 2004 12:09
OK, there are two reasons for this.

1) you are using a 1px * 1px image, but you are applying it to a very large
area. AlphaImageLoader does not tile, so you need to stretch the image to
cover the entire DIV background:
AlphaImageLoader(src='070.png',sizingMethod='scale');

2) Internet Explorer will not apply AlphaImageLoader if the element also
has the Alpha filter. Of course, to produce the fade effect, the div needs
to have alpha. The solution is to apply the AlphaImageLoader to an internal
DIV (it _must_ also have height: 100%; width: 100%;):

<div style="...Alpha(blah); etc.">
<div style="...AlphaImageLoader(blah); etc.">
 Contents
</div></div>

Note that also, the contents of the div will be made as transparent as the
alpha image. Strange idea Microsoft ...

By the way, you should be more specific when removing the background image
in the [if gte IE5.5]:
body #myDiv { background-image: none; }
Several hundred similar emails followed, migrating to IRC chat in attempt to stop my mailbox filling up :D
 
During the course of this, we discovered a bug in Mozilla's mouseout handling that can make CSS+JavaScript hybrid menus make serious mistakes.
FromMark Janssen
ToMe
SubjectSafari Colour Reproduction
Date13 January 2006 21:21
Hi Mark,

I'm bought a new iMac G5 two weeks ago and am having some problems with
colour reproduction between HTML/CSS and images in Safari. Images seem
lighter or darker than their CSS counterparts. The situation changes when
using different image formats or settings. Really weird if you ask me.
Firefox does have some better reproduction but doesn't seem to match
Photoshop's colours when having the same image open in both Photoshop and
Firefox.

Do you know about this problem? If not, would you like to receive some
screenshots I made clearly illustrating the problem?

Mark Janssen
FromMe
ToMark Janssen
SubjectRe: Safari Colour Reproduction
Date14 January 2006 12:22
Mark,

Hey, long time, no contact :)

> I'm bought a new iMac G5 two weeks ago and am having some problems with
> colour reproduction between HTML/CSS and images in Safari. Images seem
> lighter or darker than their CSS counterparts.

Safari and Mac in general use Gamma correction a lot differently to other
programs. Gamma correction is only useful when _everything_ gets corrected
the same way. With Safari, the images are "corrected", since Safari uses the
OS to render them, but the CSS does not.

The worst offender (but the easiest to correct) is PNG. Download the
TweakPNG (Windows) program that people usually use to set a sensible PNG
background colour for IE, and remove the gAMA chunk (or set the gama to the
default value; 1):
http://entropymine.com/jason/tweakpng/
Apparently you can also use PNGCrush to remove the gamma chunk, using
something like:
pngcrush -rem gAMA infile.png outfile.png

The images should in theory not be subject to gamma correction any more. You
may still find that Safari messes with image gamma anyway, since it is a
Mac, after all. You can tweak your own monitor's gamma settings using the
Mac calibration tools:

Apple menu - System Preferences - Displays - then choose to calibrate your
monitor.

This page has a very good description of the problems in various browsers,
and how to work around them:
http://hsivonen.iki.fi/png-gamma/


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromMark Janssen
ToMe
SubjectRe: Safari Colour Reproduction
Date16 January 2006 21:19
AttachmentsLoads of screenshots
Indeed no contact for some time... Hope you're doing well.

But the problem is: why does Firefox/Opera have a totally different
behaviour?

I made some screenshots, from left to right we have Photoshop - Safari -
Firefox - Opera (all latest versions). The image name shows the export
format I used. If you want you could check out the pages at:
[URLs]

I haven't modified the images after exporting from photoshop (no pngcrush
or similiar), I understand why I should do it, but on the other side I
think its just redicoulous that there are so big differences. The
screenshot.whatever picture is exported in Windows and shows up very weird
in Safari.. and the others are exported on my mac directly. But exactly no
picture had good results - jpeg80 was the best (but still not perfect).

PS.: Sorry for the large mail, but making the screenshots even smaller made
the differences a lot less clear. 
FromMe
ToMark Janssen
SubjectRe: Safari Colour Reproduction
Date17 January 2006 22:36
Mark,

> But the problem is: why does Firefox/Opera have a totally different
> behaviour?

Not entirely sure, I guess their handling of gamma is different (or non
existent). This sort of thing goes a little over my head, I'm afraid. To my
memory, Opera and Firefox will only apply gamma correction to PNGs that have
a gAMA chunk, and Safari applies it to everything. But I really don't know
I'm afraid. I can only suggest searching to see if anyone has done any
research articles about this.
FromMark Janssen
ToMe
SubjectRe: Safari Colour Reproduction
Date17 January 2006 22:46
Too bad.. I'll have to do some searching then. Couldn't find a lot last time though.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.