POV-Ray : Newsgroups : povray.advanced-users : format of hf_gray_16 .bmp files? Server Time
28 Jul 2024 16:21:48 EDT (-0400)
  format of hf_gray_16 .bmp files? (Message 11 to 20 of 27)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>
From: Mike Williams
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 15:01:10
Message: <VBi2$BA5UWzCFwJs@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>Mike Williams wrote:
>> 
>> When I use POVRay to generate a hf_gray_16 TGA file, it works as a
>> height_field.
>> 
>> When I do exactly the same thing with a PPM file generated with
>> hf_gray_16 and +fp. I get an error "Parse Error: File is not in PPM
>> format (type 53)" when I try to use it as a height_field. (POVRay 3.6
>> Windows 98se).
>
>As said with hf_gray_16 POV-Ray generates PGM files - you have to 
>specify them as 'pgm' in the heightfield statement.

Wow, how confusing. You're right and the documentation is wrong.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 15:25:01
Message: <dajvfd$dko$1@chho.imagico.de>
Mike Williams wrote:
>>
>>As said with hf_gray_16 POV-Ray generates PGM files - you have to 
>>specify them as 'pgm' in the heightfield statement.
> 
> Wow, how confusing. You're right and the documentation is wrong.
> 

What exactly do you think is wrong in the docs?

Of course the documentation of hf_gray_16 should be more elaborate - 
important information is missing but i am not aware of anything being wrong.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Christoph Hormann
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 15:35:02
Message: <dajvth$dot$1@chho.imagico.de>
Darren New wrote:
> 
> Oh, you mean OS/2 took a Windows format and modified it, but called it 
> the same thing, and screwed things up? OK. ;-)

I am sure MS would describe things like this.

> Seriously, they're *all* bitmap formats. I figured you meant the 
> microsoft bitmap format. Typing "OS/2 bitmap storage" into google and 
> hitting "I'm feeling lucky" gets you that bitmap format.

No, but this isn't really the topic - i just wanted to point out that 
there is nothing even approximately as well defined as the PPM/PGM specs 
for BMP.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Darren New
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 15:42:26
Message: <42cd85a2$1@news.povray.org>
Christoph Hormann wrote:
 > No, but this isn't really the topic - i just wanted to point out that
 > there is nothing even approximately as well defined as the PPM/PGM specs
 > for BMP.

OK. I'd disagree, given the resources I pointed you to and the number of 
people who have written to the specs. And in spite of the specs being 
well-defined for PPM/PGM, it's not the case that everyone importing 
those formats follows the specs either, including POV-Ray.

-- 
   Darren New / San Diego, CA, USA (PST)
     The samba was clearly inspired
     by the margarita.


Post a reply to this message

From: Mike Williams
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 15:49:36
Message: <ZPlVMAAlYYzCFwo5@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>Mike Williams wrote:
>>>
>>>As said with hf_gray_16 POV-Ray generates PGM files - you have to 
>>>specify them as 'pgm' in the heightfield statement.
>> 
>> Wow, how confusing. You're right and the documentation is wrong.
>> 
>
>What exactly do you think is wrong in the docs?

It says that you can use a PPM file as a 16-bit height field, but you
have to use a PGM file (and the syntax is "height_field pgm filename").

It says that +fp outputs a PPM file, but if hf_gray_16 is active the
output is a PGM file with an incorrect extension.

I don't think that there's any way that someone could guess the correct
way to use PGM hf_gray_16 files by reading the documentation.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 15:55:02
Message: <dak17s$dvs$1@chho.imagico.de>
Darren New wrote:
> And in spite of the specs being
> well-defined for PPM/PGM, it's not the case that everyone importing 
> those formats follows the specs either, including POV-Ray.

In what way does POV-Ray's reading of PPM/PGM not follow the specs?

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Christoph Hormann
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 16:20:01
Message: <dak2g9$e9p$1@chho.imagico.de>
Mike Williams wrote:
> 
> It says that you can use a PPM file as a 16-bit height field, but you
> have to use a PGM file (and the syntax is "height_field pgm filename").

You can use a PPM file in a height_field,

height_field {
   ppm "test.ppm"
}

works for any valid PPM - of course not for a PGM.

> It says that +fp outputs a PPM file, but if hf_gray_16 is active the
> output is a PGM file with an incorrect extension.

That's right.

> I don't think that there's any way that someone could guess the correct
> way to use PGM hf_gray_16 files by reading the documentation.

What's unclear about the use of PGMs? - you can use them in 
heightfields, image maps and elsewhere just like any other image file 
format supported.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

From: Mike Williams
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 19:35:42
Message: <psnpkEAvpbzCFw87@econym.demon.co.uk>
Wasn't it Christoph Hormann who wrote:
>Mike Williams wrote:
>> 
>> It says that you can use a PPM file as a 16-bit height field, but you
>> have to use a PGM file (and the syntax is "height_field pgm filename").
>
>You can use a PPM file in a height_field,
>
>height_field {
>   ppm "test.ppm"
>}

Doesn't that only work for 8-bit PPM files, whereas the documentation
states that it works for 16-bit PPMs.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Ralph Smith
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 21:01:14
Message: <crjrc1duj4ahig659akln9iqrdmf83fbg5@4ax.com>
I've looked into a .tga height field file. It looks like only the red and green pixel
components are
used. The blue and alpha components are always 0. So, I guess that I can get a 16 bit
hf_gray_16
file if I set the red and green bytes between 0 and 0xffff. If so, which is the most
significant
byte?

Ralph


Post a reply to this message

From: Darren New
Subject: Re: format of hf_gray_16 .bmp files?
Date: 7 Jul 2005 21:14:30
Message: <42cdd376$1@news.povray.org>
Christoph Hormann wrote:
> In what way does POV-Ray's reading of PPM/PGM not follow the specs?

In some places it required either one space or one newline in the header 
where the spec specified "whitespace". My code was doing something like

print "P5 $width $height $depth" and POV-Ray was looking for a newline 
after the P5 or some such. I don't remember the exact details.

-- 
   Darren New / San Diego, CA, USA (PST)
     The samba was clearly inspired
     by the margarita.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 7 Messages >>>

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