Why is the imagedata value different from Win32 to MacOS

Dar Scott dsc at swcp.com
Wed Jul 26 11:29:30 EDT 2006


On Jul 26, 2006, at 4:16 AM, Joel Guillod wrote:

> My guess from my investigations is that there is some issue in the  
> algorithm used to calculate the imagedata in  the rev engine and  
> which is a function of the screengamma, the image gamma and some  
> obscure stuff... because extreme color channel values (near 0 or  
> near 255) are correct and the differences are bigger when in the  
> middle (near 127). So the gamma correction could be fault.

I'm coming in a little late in this, so I may miss the mark.

I pulled out an old PNG dump script and noticed that most PNG images  
have both gAMA and cHRM chunks.  Maybe some environments interpret  
only one and not both.

IIRC, for painted images, the values refer to the environment that  
the painting was done in.  If I understand that right, a new  
environment has to undo that and then redo the color processing for  
the new environment.

I remember something about Windows making some assumptions about  
gamma, but I forgot what.

I have a vague memory of long ago checking and seeing that imageData  
was _before_ gamma changes.  Maybe Rev changed or I slipped in from a  
similar neighboring universe.  Again, sigh.

I am successful with a test image just now in exporting to the P6  
format of PPM, the default export.  You might get something other  
than P6, so check the PBM/PGM/PPM format.  It is easy to parse.  It  
is for P6, I think, the rgb byte triples in binary right after the  
header, that is, right after the 3rd lf in Rev's case.  You might  
want to compare or use that data.  More is online, google for P6 PPM.

I got a compiler error in trying to export a mask.

I hope that gives some hints.

Dar Scott




More information about the use-livecode mailing list