PNGs and screenGamma

Devin Asay devin_asay at byu.edu
Fri Jul 1 18:33:57 EDT 2011


Hi all,

About a year and a half ago Scott Rossi posted this useful tip:

> This might be useful for folks delivering image-heavy apps on Mac OS X 10.6
> and later...
> 
> Apparently with Snow Leopard, Apple has changed the default gamma of the
> system to 2.2 (used to be 1.8).
> 
> <http://blogs.adobe.com/jnack/2009/09/why_your_web_content_will_look_darker.
> html>
> 
> I was recently throwing some PNG images on a card on Rev that looked
> significantly darker than where they were created (in Photoshop), and for
> the life of me could not figure out why.  I'm still searching for a reliable
> way to strip the gamma information from PNG images, but after finding the
> above article, I tried changing the screenGamma in Rev to 2.2 and amazingly
> (or maybe expectedly) the image seems to display properly.
> 
> set the screenGamma to 2.2
> 
> I need to do some more testing, but it appears that when delivering apps on
> Snow Leopard that make heavy use of PNGs, one will need to do something to
> the effect of:
> 
> if "mac" is in platform() and systemVersion() > 10.5 then ...
> 
> Also used the following method to force refresh the display of the image:
> 
> set text of img 1 to text of img 1
> 
> Hope this saves some head banging for other folks using images.
> 
> Regards,
> 
> Scott Rossi
> Creative Director
> Tactile Media, UX Design

Just now, I've run into this exact same problem. I tried applying Scott's workaround, only to discover that it only works with Revolution 4.0 and earlier. Any time I try to display these same PNGs in LiveCode 4.5 or higher they come out significantly darker, regardless of whether I reset the screenGamma. Oddly, PNGs that were originally produced in OS X 10.5 do not come out darker, so it definitely has something to do with 10.6. Only the latest versions of LC don't allow me to correct the problem any more.

Has anyone run into this, and has anyone found a solution?

Regards,

Devin



Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list