POV-Ray : Newsgroups : povray.general : Converting to usable 16 bit height-fields Server Time
5 Nov 2024 03:15:11 EST (-0500)
  Converting to usable 16 bit height-fields (Message 1 to 5 of 5)  
From: Andy W
Subject: Converting to usable 16 bit height-fields
Date: 24 Nov 2007 06:55:00
Message: <web.474810fb8bc0e1a5169c9cb20@news.povray.org>
Hello. I'm new to POV-ray and new to these groups. I'm trying to use POV to
create nice photo-real earth imagery (or exaggerated earth imagery, boosting up
the terrain).

To try and do this I've got satellite imagery, which I can drape over
height-field topography. This looks fine using some 8 bit topography entered as
height-field.

But when I try and bring in 16-bit imagery I can't seem to get it to work. It
clearly doesn't support 16-bit GeoTIFF, so I've tried converting from GeoTIFF
(and from raw) using Image-Magick to get one of the 16 bit formats supported by
POV. I've created 16 bit PGM, and 16 bit PNG (as well as all sorts of odd
formats with 16-bit red channel and nothing green or blue), but these don't
seem to create what I want.

It looks like they are overflowing at the value 256, and are not really 16 bit.
Or there's a little-endian/big-endian confusion, but switching between the two
doesn't help.

Is there something special in the 16 bit formats used by POV? Are they signed or
unsigned? And can anyone recommend a way of creating usable 16 height-fields
from raw or geotiff files [I'm exporting these from Global Mapper if anyone is
familiar]? What options would be sensible on an image magick command line to
create these?

For your information, I'm working under Windows XP, and at the moment don't have
any compilers for a recompilation as I'm scared of compiling anything under Win
because it's such a stupid system.

Thanks in advance if anyone can help me.


Post a reply to this message

From: Alain
Subject: Re: Converting to usable 16 bit height-fields
Date: 24 Nov 2007 11:10:06
Message: <47484cde$1@news.povray.org>
Andy W nous apporta ses lumieres en ce 2007/11/24 06:54:
> Hello. I'm new to POV-ray and new to these groups. I'm trying to use POV to
> create nice photo-real earth imagery (or exaggerated earth imagery, boosting up
> the terrain).
> 
> To try and do this I've got satellite imagery, which I can drape over
> height-field topography. This looks fine using some 8 bit topography entered as
> height-field.
> 
> But when I try and bring in 16-bit imagery I can't seem to get it to work. It
> clearly doesn't support 16-bit GeoTIFF, so I've tried converting from GeoTIFF
> (and from raw) using Image-Magick to get one of the 16 bit formats supported by
> POV. I've created 16 bit PGM, and 16 bit PNG (as well as all sorts of odd
> formats with 16-bit red channel and nothing green or blue), but these don't
> seem to create what I want.
> 
> It looks like they are overflowing at the value 256, and are not really 16 bit.
> Or there's a little-endian/big-endian confusion, but switching between the two
> doesn't help.
> 
> Is there something special in the 16 bit formats used by POV? Are they signed or
> unsigned? And can anyone recommend a way of creating usable 16 height-fields
> from raw or geotiff files [I'm exporting these from Global Mapper if anyone is
> familiar]? What options would be sensible on an image magick command line to
> create these?
> 
> For your information, I'm working under Windows XP, and at the moment don't have
> any compilers for a recompilation as I'm scared of compiling anything under Win
> because it's such a stupid system.
> 
> Thanks in advance if anyone can help me.
> 
> 
Try the TGA or PPM format. High byte in the red channel, low byte in the green 
channel, blue set to zero.
This is the format used when you set hf_gray_16 in global settings and the 
output as TGA.

You may also use 16 bits PNG and POT file.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when your wife's raytraced image you 
made to flatter her is the only one you see of her anymore.
Ken Tyler


Post a reply to this message

From: Leroy
Subject: Re: Converting to usable 16 bit height-fields
Date: 24 Nov 2007 20:37:03
Message: <4748D186.9050908@joplin.com>
First, It's nice to have a new POVer. Welcome!! :)

Next, Alain's right in his description of how POV uses 16 bits of an 
image to make a height field.

I don't know about 'image magick'.
I had look for the longest tine to find software that make a 16 bit from 
a 256 color image. I don't remember how many I've loaded then deleted 
because they didn't work. So I wrote my own height field maker and 
converter. You can try my 'Mapper Fix' program at 
(http://leroywhetstone.s5.com/)

The main trouble with any image converter use for height fields is 
noise. That is the converter takes the color of a pixel as the height of 
a location instead of using the index value.


Post a reply to this message

From: Andy W
Subject: Re: Converting to usable 16 bit height-fields
Date: 26 Nov 2007 06:10:00
Message: <web.474aa8a0f40b7d4d5d6df44f0@news.povray.org>
Thanks for the pointers, and the welcome, both of you.

But I'm still floundering: I already have good, correct, 16 bit data, for the
areas I want to render. I need to find software that will convert into the TGA
format or a single channel 16 bit PGM (or, at the very least, extract the most
significant bit and least significant bit, so I can put them into a tga image).

I can work a long, tedious hack that can achieve this, I think, but if there's
software that can do the trick.

What's bothering me at the moment is that I feel that I already have a 16 bit
PGM, and POV is merely taking the least significant bit and rendering that,
leaving me with everything peaking at 256 meters.


Post a reply to this message

From: Andy W
Subject: Re: Converting to usable 16 bit height-fields
Date: 26 Nov 2007 06:50:00
Message: <web.474ab2dcf40b7d4d5d6df44f0@news.povray.org>
Ah-ha! I think I have it. My converter assumes an unsigned 16-bit integer, and
my data is signed 16 bit. So what happens is that everything below sea level is
coming through as something around 65000 meters, and by scaling to keep that on
screen, everything else looks to be close to flat.

My guess is the POV, too, works assuming unsigned 16 bit (0-65536) rather than
signed 16 bit (-32768-32789), as it is working, generally, with image formats
rather than with data formats.


Post a reply to this message

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