POV-Ray : Newsgroups : povray.general : ppm troubles Server Time
5 Aug 2024 04:19:54 EDT (-0400)
  ppm troubles (Message 1 to 4 of 4)  
From: ingo
Subject: ppm troubles
Date: 26 Dec 2002 13:15:36
Message: <Xns92F0C42D2BD4seed7@povray.org>
It seems POV-Ray has problems reading ppm-files it has generated itself.

- Run the first scene, then use the result in the second scene below.

- With any value of the +fp commandline-switch between 0 and 13 for the 
first scene,  rendering the second scene results is an error:

  File: D:\Ingo\SceneTest\test2.pov  Line: 47
    image_map {

      ppm "test1.ppm" <----ERROR

  Parse Error: Unsupported number of colors (0) in PPM image.


- If the value for +fp is in the range 14-16, an image is rendered but the 
result is garbled.

- Doing the same with png's gives a perfect result.

====================================
// test1.pov
// +w500 +h500 +fp(0-13)(14-16)
#version 3.5;
global_settings {assumed_gamma 1.0}
camera {
  orthographic
  location -z
  look_at 0
  right x*image_width/image_height
  angle 90
}
box {
  <-1,-1,0><1,1,1>
  pigment {
    gradient y
    translate <0,0.5,0>
    scale 2
  }
  finish {ambient 1}
}

=====================================

// test2.pov
// +w500 +h500
#version 3.5;
global_settings {assumed_gamma 1.0}
camera {
  orthographic
  location -z
  look_at 0
  right x*image_width/image_height
  angle 90
}
box {
  <-1,-1,0><1,1,1>
  pigment {
    image_map {
      ppm "test1.ppm"
      interpolate 2
      once
    }
    translate <-0.5,-0.5,0> 
    scale 2
  }
  finish {ambient 1}
} 
======================================

POV-Ray 3.5.icl.win32, Win2000, Athlon 1800+, 1.5 GB

Ingo


Post a reply to this message

From: Ive
Subject: Re: ppm troubles
Date: 26 Dec 2002 16:15:00
Message: <3e0b7154@news.povray.org>
>It seems POV-Ray has problems reading ppm-files it has generated itself.

This seems to be true, at least for the windows version. The funny thing is:
POV writes the files correct but is unable to read them.
I have checked the header, it is in simple ascii format, where P6 stands for
rgb data in binary format, next line is image width and height followed by the
color range (e.g. 255 for 8bit). Note that most image viewer (like IrvanView)
do not read other formats tham 255 (8bit) correct but all bit format as written
by pov are valid ppm files.
Just found one more problem. Any line that starts with '#' in the header is a
comment and should be ignored by the reading software. POV becomes
confused when there is any comment line in the header.
Do all this things also happen with the linux version where ppm is a more native
image format?
Guess I will look up the source and will integrate a bug fix for reading ppm files
into my own POV-Patch.

-Ive


Post a reply to this message

From: ingo
Subject: Re: ppm troubles
Date: 28 Dec 2002 10:08:50
Message: <Xns92F2A483F165seed7@povray.org>
in news:3e0b7154@news.povray.org Ive wrote:

> This seems to be true,

Thanks Ive, for the confirmation. I'll make a bugreport for it.

Ingo


Post a reply to this message

From: PoD
Subject: Re: ppm troubles
Date: 25 Jan 2003 07:20:22
Message: <pan.2003.01.25.12.20.20.481352@internode.on.net>
On Sat, 28 Dec 2002 10:08:50 +0000, ingo wrote:

> in news:3e0b7154@news.povray.org Ive wrote:
> 
>> This seems to be true,
> 
> Thanks Ive, for the confirmation. I'll make a bugreport for it.
> 
> Ingo

If you're still looking for a fix for this I've started going through
ppm.cpp and fixing it up (I found an old utility of my own that outputs
ppms).
Diff posted in povray.binaries.programming

-- 
PoD.


Post a reply to this message

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