POV-Ray : Newsgroups : povray.beta-test : Suspicious PGM/PPM file format handling : Re: Suspicious PGM/PPM file format handling Server Time
6 Jul 2024 06:01:55 EDT (-0400)
  Re: Suspicious PGM/PPM file format handling  
From: Ive
Date: 14 Sep 2009 09:24:15
Message: <4aae43ff$1@news.povray.org>
clipka wrote:
> (A) In PPM files, the value appears to be consistently interpreted as 
> the value that would represent 1.0. The same applies to PGM files with a 
> "maxvalue" of 255 or less.
> 
> (B) For PGM files with a "maxvalue" of 256 or higher however, maxvalue 
> appears to be effectively ignored, and the values interpreted as if 
> 65535 would represent 1.0.
> 
> 
> Can someone confirm this in practice?
> 
> Any suggestions how to handle this? I would consider (B) a bug and 
> change it - even at the cost of potentially breaking existing scenes, 
> speculating that most files with a "maxvalue" > 255 do have a value of 
> 65535 anyway.

B is a bug and your speculation is valid.

There are indeed some (but very rare) PNM files that seem to assume 
"maxvalue" is the maximal value that *appears* within the image out of 
the full range of 0-65535 but this is a bug within the used PNM-writer 
and shouldn't become our problem.

-Ive


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.