Thomas DeWeese wrote:
[...]

Two little questions from someone not really knowing about PNG: is there absolutely no situation you might want to set a 2.2 gamma without wanting sRGB?


The PNG specification requires that the gamma and chrm chunks be set
appropriately for sRGB. Remember sRGB is _a_ colorspace it is not a
family of colorspaces. It would be wrong to say you have an image in
sRGB with a gamma of 2.0 - the image would not be in sRGB it might share
the chromaticities of sRGB but if the rendering curve is different it is
not the same colorspace.

I was thinking the other way round: setting the 2.2, but not the sRGB. It seems the new code would allow that.



And won't you have the same problem as the spec that 2.2 might not always be the same as 2.2 -- e.g. if someone cast a float to a double? Just try this:

System.out.println(2.2 == 2.2f);

Intuitively I'd skip the extra rule for 2.2 -- no gamma given is already sRGB. Two ways to achieve the same seem to just create confusion -- esp. if one of the methods might not always work.


I decided to go this way for cases where someone did not want the
sRGB chunk to be written but they still wanted sRGB chrm and gama
chunks.

Exactly.



For constants I don't worry so much about cases like the above also all
Key values will be mapped to a float along the way anyways.

Hmmm.... how well defined is the mapping from double to float? Java defines most of these things, but not necessarily all. Is new Float(2.2) a constant across platforms? Would a version compiled on ACME JDK 1.7 on OS W (can't use X anymore) work on EMCA JDK 2.3 on OS V? I just wouldn't want to rely on these things ;-) Probably even not if I find some rule in the spec -- it would be too likely that I am on a lonely side if a JDK doesn't follow the spec properly.


Anyway -- the new code works like a charm for me and I am getting too academic. Thanks for the fix.

Peter


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to