POV-Ray : Newsgroups : povray.binaries.utilities : Looking for a 16bit heightfield to logarithmic converter Server Time
31 Oct 2024 12:18:59 EDT (-0400)
  Looking for a 16bit heightfield to logarithmic converter (Message 1 to 7 of 7)  
From: anidon
Subject: Looking for a 16bit heightfield to logarithmic converter
Date: 17 Dec 2003 17:15:01
Message: <web.3fe0d3a33700ea6ca9e850180@news.povray.org>
I use POVRAY to make images of straylight in optical systems.  The very low
intensity parts of the image are the most interesting.  Although the
information is present in the red/green image it is not visually
intelligible. It would be nice to have a POV output file format that was
logarithmic - but otherwise a *.exe utility which inputs the heightfield
and outputs an image file which is proportional to the log ( decimal or
natural )of 1 to 65535.

Is anyone able and willing and sufficiently interested to create one and
publish it?


Post a reply to this message

From: Mike Williams
Subject: Re: Looking for a 16bit heightfield to logarithmic converter
Date: 18 Dec 2003 01:30:29
Message: <JKrqeDANlU4$Ewki@econym.demon.co.uk>
Wasn't it anidon who wrote:
>I use POVRAY to make images of straylight in optical systems.  The very low
>intensity parts of the image are the most interesting.  Although the
>information is present in the red/green image it is not visually
>intelligible. It would be nice to have a POV output file format that was
>logarithmic - but otherwise a *.exe utility which inputs the heightfield
>and outputs an image file which is proportional to the log ( decimal or
>natural )of 1 to 65535.
>
>Is anyone able and willing and sufficiently interested to create one and
>publish it?


If you have an image processing program that accepts Adobe-compatible
plugins, then I can let you have a plugin that will perform such
processing. Windows only. I've tried testing it on a dark HF_gray_16 TGA
file, and it seems to be doing the right sort of thing, but I don't have
any images that are in any way improved by being logarithmised and the
output looks pretty naff until I perform additional contrast and
brightness processing.

If you don't have an image processing program that accepts Adobe-
compatible plugins, then it's possible to do it for free with Irfanview,
by installing "8BF-Filters.dll" from the Irfanview plugins page, which
allows Irfanview to run Adobe-compatible plugins.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Looking for a 16bit heightfield to logarithmic converter
Date: 18 Dec 2003 07:04:10
Message: <ynQ0lBAjeZ4$EwQC@econym.demon.co.uk>
Wasn't it Mike Williams who wrote:
>Wasn't it anidon who wrote:
>>I use POVRAY to make images of straylight in optical systems.  The very low
>>intensity parts of the image are the most interesting.  Although the
>>information is present in the red/green image it is not visually
>>intelligible. It would be nice to have a POV output file format that was
>>logarithmic - but otherwise a *.exe utility which inputs the heightfield
>>and outputs an image file which is proportional to the log ( decimal or
>>natural )of 1 to 65535.
>>
>>Is anyone able and willing and sufficiently interested to create one and
>>publish it?
>
>
>If you have an image processing program that accepts Adobe-compatible
>plugins, then I can let you have a plugin that will perform such
>processing. Windows only. I've tried testing it on a dark HF_gray_16 TGA
>file, and it seems to be doing the right sort of thing, but I don't have
>any images that are in any way improved by being logarithmised and the
>output looks pretty naff until I perform additional contrast and
>brightness processing.
>
>If you don't have an image processing program that accepts Adobe-
>compatible plugins, then it's possible to do it for free with Irfanview,
>by installing "8BF-Filters.dll" from the Irfanview plugins page, which
>allows Irfanview to run Adobe-compatible plugins.

I've now put the plugin on my website

http://www.econym.demon.co.uk/plugins/index1.htm

There seems to be a bit of a problem if you use the plugin with Paint
Shop Pro 8. I can't find any way to persuade PSP8 to save the data in
HF_Grey_16 format that's accepted by POV as a heightfield after
processing. It seems to be OK under Irfanview and PSP7.

I currently use the following rules (when my "Scale" parameter is left
at zero):

For 8-bit grey output: output=loge(input)*23.0832

For HF_Grey_16 output: output=loge(input)*5909

[These magic numbers were chosen such that the max input value of 65535
maps to the max output value (255 and 65535 respectively)]

I could easily change it to use other rules if you'd like. Or I could
write one that applies Gamma correction from HF_Grey_16 to HF_Grey_16.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: Looking for a 16bit heightfield to logarithmic converter
Date: 18 Dec 2003 13:12:55
Message: <2JS+9BAV3e4$EwCB@econym.demon.co.uk>
Wasn't it Mike Williams who wrote:
>Wasn't it Mike Williams who wrote:
>>Wasn't it anidon who wrote:
>>>I use POVRAY to make images of straylight in optical systems.  The very low
>>>intensity parts of the image are the most interesting.  Although the
>>>information is present in the red/green image it is not visually
>>>intelligible. It would be nice to have a POV output file format that was
>>>logarithmic - but otherwise a *.exe utility which inputs the heightfield
>>>and outputs an image file which is proportional to the log ( decimal or
>>>natural )of 1 to 65535.
>>>
>>>Is anyone able and willing and sufficiently interested to create one and
>>>publish it?
>>
>>
>>If you have an image processing program that accepts Adobe-compatible
>>plugins, then I can let you have a plugin that will perform such
>>processing. Windows only. I've tried testing it on a dark HF_gray_16 TGA
>>file, and it seems to be doing the right sort of thing, but I don't have
>>any images that are in any way improved by being logarithmised and the
>>output looks pretty naff until I perform additional contrast and
>>brightness processing.
>>
>>If you don't have an image processing program that accepts Adobe-
>>compatible plugins, then it's possible to do it for free with Irfanview,
>>by installing "8BF-Filters.dll" from the Irfanview plugins page, which
>>allows Irfanview to run Adobe-compatible plugins.
>
>I've now put the plugin on my website
>
>http://www.econym.demon.co.uk/plugins/index1.htm
>
>There seems to be a bit of a problem if you use the plugin with Paint
>Shop Pro 8. I can't find any way to persuade PSP8 to save the data in
>HF_Grey_16 format that's accepted by POV as a heightfield after
>processing. It seems to be OK under Irfanview and PSP7.
>
>I currently use the following rules (when my "Scale" parameter is left
>at zero):
>
>For 8-bit grey output: output=loge(input)*23.0832
>
>For HF_Grey_16 output: output=loge(input)*5909
>
>[These magic numbers were chosen such that the max input value of 65535
>maps to the max output value (255 and 65535 respectively)]
>
>I could easily change it to use other rules if you'd like. Or I could
>write one that applies Gamma correction from HF_Grey_16 to HF_Grey_16.
>

Oops.

There turned out to be a bit of a glitch in my plugin. The system I used
is documented as having 32-bit arithmetic, but in practice numbers
higher than 32767 were turning negative. Since I was dealing with 16-bit
greyscales, I needed to handle numbers up to 65535.

It's fixed now, but if you grabbed a version below v1.2, then expect it
to only work with dark images, like the ones I initially tested it with.

I've added a second plugin for linearly adjusting the brightness and
contrast of a HF_grey_16 image. It's actually a bit pointless because
you can achieve the same effects by linearly translating and scaling the
height_field in POV. It did, however, clue me in to the  bug in the
first plugin.

I've now moved my HF plugins to a separate page of their own, since most
plugin users would be unlikely to be interested in them:

http://www.econym.demon.co.uk/plugins/hf.htm

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Stephen McAvoy
Subject: Re: Looking for a 16bit heightfield to logarithmic converter
Date: 19 Dec 2003 06:44:44
Message: <15p5uvg1qr2r9upj5fa5g882j8evi2g6nt@4ax.com>
On Thu, 18 Dec 2003 18:11:33 +0000, Mike Williams <nos### [at] econymdemoncouk>
wrote:

>
>http://www.econym.demon.co.uk/plugins/hf.htm

Nothing to do with this thread, just wanted to say I love the backgrounds on you
site. If you weren't "churchy" I would say, "Can I have some of what you've been
smoking" :-}


Regards
        Stephen


Post a reply to this message

From: Mike Williams
Subject: Re: Looking for a 16bit heightfield to logarithmic converter
Date: 19 Dec 2003 13:49:56
Message: <XTLWrDAyW04$EwHk@econym.demon.co.uk>
Wasn't it Stephen McAvoy who wrote:
>On Thu, 18 Dec 2003 18:11:33 +0000, Mike Williams <nos### [at] econymdemoncouk>
>wrote:
>
>>
>>http://www.econym.demon.co.uk/plugins/hf.htm
>
>Nothing to do with this thread, just wanted to say I love the backgrounds on you
>site. If you weren't "churchy" I would say, "Can I have some of what you've been
>smoking" :-}
>

It's just a few randomized f_noise3d pigment functions.


camera {orthographic  right 2*x up 2*y 
        direction z  location <0, 0, -100>}

#include "functions.inc"
#declare R1=seed(51);

#declare A=rand(R1);
#declare B=rand(R1);

#declare F=function{f_noise3d(x*10*A,y*10*A,0)}
#declare G=function{f_noise3d(x*10*B,y*10*B,0)}

plane {z,0 pigment {
    function {
        F(abs(x),abs(y),0)
    }
      color_map {
        #local C = 0;
        #while (C < 1.1)
          #declare C1=<rand(R1), rand(R1), rand(R1)>;
          [C rgb C1]
          #declare C = C + .01 + rand(R1)*.1;
          [C rgb C1]
        #end }
  }
  finish {ambient 1}
}

plane {z,-1 pigment {
    function {
        G(abs(x),abs(y),0)
    }
      color_map {
        #local C = 0;
        #while (C < 1.1)
          #declare C1=<rand(R1), rand(R1), rand(R1), rand(R1)>;
          [C rgbt C1]
          #declare C = C + .01 + rand(R1)*.1;
          [C rgbt C1]
        #end }
  }
  finish {ambient 1}
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Stephen McAvoy
Subject: Re: Looking for a 16bit heightfield to logarithmic converter
Date: 19 Dec 2003 13:55:56
Message: <vai6uv0jtsm5p4aupn6bkvrllj3qvtv39a@4ax.com>
On Fri, 19 Dec 2003 18:38:42 +0000, Mike Williams <nos### [at] econymdemoncouk>
wrote:

>
>It's just a few randomized f_noise3d pigment functions.

It looks quite Aztec-ish to me but the proof of the pudding is in the formula.


Regards
        Stephen


Post a reply to this message

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