POV-Ray : Newsgroups : povray.general : higher "color" resolution grayscale images Server Time
17 Nov 2024 23:15:50 EST (-0500)
  higher "color" resolution grayscale images (Message 1 to 6 of 6)  
From: Bill Brehm
Subject: higher "color" resolution grayscale images
Date: 16 Dec 2002 21:26:51
Message: <3dfe8b6b@news.povray.org>
Hi,

I need to generate some grayscale images at 10 bits (1024 levels) or more
per pixel. I've read the documentation and I can generate 48 bit color PNG
files. The problem is, I haven't been able to find any program to convert
them to 16 bit grayscale images. I had no problem finding a program to
convert from 24 bit color to 8 bit grayscale. But even though some of them
can read in the 48 bit PNG files, they generate 8 bit grayscale when
converting.

I also need the output file to be converted to TIFF and to have totally
lossless compression, if any. I don't actual need compression. But if it's
there, and I get the distortion that is seen in JPG images, I won't be able
to use them.

I've tried selecting a grayscale palette, but that only affects the display
and no the output file.

So,

1. is there a way to make POVRay render the image directly to 16 bit
grayscale?
2. can anyone recommend a program (preferably freeware or shareware, so I
can try it first) that can read in 48 bit color or 16 bit grayscale PNG
files and convert them to a 16 bit grayscale TIFF file?

Thanks,

Bill


Post a reply to this message

From: PoD
Subject: Re: higher "color" resolution grayscale images
Date: 17 Dec 2002 06:46:25
Message: <pan.2002.12.17.11.49.37.370355@internode.on.net>
On Tue, 17 Dec 2002 10:26:40 +0800, Bill Brehm wrote:

> 1. is there a way to make POVRay render the image directly to 16 bit
> grayscale?
> 2. can anyone recommend a program (preferably freeware or shareware, so I
> can try it first) that can read in 48 bit color or 16 bit grayscale PNG
> files and convert them to a 16 bit grayscale TIFF file?
> 

1. Put 'hf_gray_16 on' in the global_settings section as per 6.11.4 in the
  3.5 manual. This will cause POV-Ray to output a 16 bit greyscale file

2. I think that the latest version of ImageMagick is meant to do 16 bit
  image conversions.  I haven't tried this yet though.

Cheers,
  PoD.


Post a reply to this message

From: Bill Brehm
Subject: Re: higher "color" resolution grayscale images
Date: 17 Dec 2002 21:35:16
Message: <3dffdee4@news.povray.org>
Thanks.

I was looking in the file output section, so I didn't stumble across
hf_gray_16 in the global settings. I tried it and it seems to work; at least
I'm getting gray output. While I can tell the difference between color and
grayscale, I can't with my eyes determine the number of grayscale bits. So I
have a few additional questions.

1a. If I need only 10 bit grayscale (or any other number between 8 and 16),
will Bits_Per_Color=10 only allow 10 bits of grayscale info to be written
into the file, assuming Output_File_Type=N?

1b. If I use Output_File_Type=N, I'll get a PNG file which can accept up to
16 bits of grayscale info. If I use Output_File_Type=S, will I get a BMP
file with only 8 bits of grayscale info? (This will be helpful to me too in
some cases, as I've been generating 24 bit color images and converting them
to grayscale with a separate utility and maybe now I can generate the 8 bit
grayscale BMP files directly.)

2. I was not aware of ImageMagick. I will download it tonight and try it
out.

3. The reason I am using grayscale is because I need to generate some images
to test what a monochrome analog or digital camera will see in a piece of
machinery I'm working on, in order to test some computer vision algorithms.
This leads me to a question that's not directly POVRay related, but someone
out there may know. I see that hf_gray_16 causes POVRay to use the luminance
formula to convert the color image to gray. I understand the reason for the
.3, .59 and .11 parameters is because that matches the human eye's
sensitivity to the three primary colors of light. Will a monochrome camera,
as used in most equipment with machine vision, have a similar sensitivity?
To put it another way, will a color camera looking at a color scene and
having its image converted to grayscale with the luminance formula produce
the "exact" same image as a monochrome camera looking at that same color
scene?

4. What is the purpose of a height field image? Any example scenes available
on this news server that show its application?

Thanks again,

Bill



"PoD" <pod### [at] internodeonnet> wrote in message
news:pan### [at] internodeonnet...
> On Tue, 17 Dec 2002 10:26:40 +0800, Bill Brehm wrote:
>
> > 1. is there a way to make POVRay render the image directly to 16 bit
> > grayscale?
> > 2. can anyone recommend a program (preferably freeware or shareware, so
I
> > can try it first) that can read in 48 bit color or 16 bit grayscale PNG
> > files and convert them to a 16 bit grayscale TIFF file?
> >
>
> 1. Put 'hf_gray_16 on' in the global_settings section as per 6.11.4 in the
>   3.5 manual. This will cause POV-Ray to output a 16 bit greyscale file
>
> 2. I think that the latest version of ImageMagick is meant to do 16 bit
>   image conversions.  I haven't tried this yet though.
>
> Cheers,
>   PoD.
>


Post a reply to this message

From: PoD
Subject: Re: higher "color" resolution grayscale images
Date: 18 Dec 2002 06:31:06
Message: <pan.2002.12.18.11.34.24.425316@internode.on.net>
On Wed, 18 Dec 2002 10:35:01 +0800, Bill Brehm wrote:

> Thanks.
> 
> I was looking in the file output section, so I didn't stumble across
> hf_gray_16 in the global settings. I tried it and it seems to work; at
> least I'm getting gray output. While I can tell the difference between
> color and grayscale, I can't with my eyes determine the number of
> grayscale bits. So I have a few additional questions.
> 
> 1a. If I need only 10 bit grayscale (or any other number between 8 and
> 16), will Bits_Per_Color=10 only allow 10 bits of grayscale info to be
> written into the file, assuming Output_File_Type=N?

5.2.2.3.1 claims that POV-Ray will output 5-16 bits.
I think I remember reading that PNG files actually use either 8 or 16 bits
per channel but outputting less eg. 10 bits will make the files smaller
since the extra bits are all zeros and compress very well.

> 
> 1b. If I use Output_File_Type=N, I'll get a PNG file which can accept up
> to 16 bits of grayscale info. If I use Output_File_Type=S, will I get a
> BMP file with only 8 bits of grayscale info? (This will be helpful to me
> too in some cases, as I've been generating 24 bit color images and
> converting them to grayscale with a separate utility and maybe now I can
> generate the 8 bit grayscale BMP files directly.)
> 

Not sure what happens to BMP output with hf_gray_16

> 2. I was not aware of ImageMagick. I will download it tonight and try it
> out.
> 
> 3. The reason I am using grayscale is because I need to generate some
> images to test what a monochrome analog or digital camera will see in a
> piece of machinery I'm working on, in order to test some computer vision
> algorithms. This leads me to a question that's not directly POVRay
> related, but someone out there may know. I see that hf_gray_16 causes
> POVRay to use the luminance formula to convert the color image to gray. I
> understand the reason for the .3, .59 and .11 parameters is because that
> matches the human eye's sensitivity to the three primary colors of light.
> Will a monochrome camera, as used in most equipment with machine vision,
> have a similar sensitivity? To put it another way, will a color camera
> looking at a color scene and having its image converted to grayscale with
> the luminance formula produce the "exact" same image as a monochrome
> camera looking at that same color scene?

There is some variation in the contribution of the 3 colour components in
different systems 0.3,0.59,0.11 seems fairly common but a particular
camera may give a slightly different result.

> 
> 4. What is the purpose of a height field image? Any example scenes
> available on this news server that show its application?
> 

The best answer to this question is in the documentation 6.5.1.5
Nearly every landscape will have at least one heightfield.

-- 
PoD.


Post a reply to this message

From: Warp
Subject: Re: higher "color" resolution grayscale images
Date: 18 Dec 2002 08:24:13
Message: <3e0076fd@news.povray.org>
PoD <pod### [at] internodeonnet> wrote:
> Not sure what happens to BMP output with hf_gray_16

  I think that it uses the R and G values for the grayscale value (and leaves
B to 0), but I can't remember for sure.
  This mode is nowadays quite seldom needed and only usable by specialized
programs (usually HF-generation ones). Of course POV-Ray itself is one such
program, so there might be some use for it (even though less likely nowadays,
as we can create heightfields from any function...).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: higher "color" resolution grayscale images
Date: 18 Dec 2002 11:43:24
Message: <chrishuff-6BD94D.11383318122002@netplex.aussie.org>
In article <3e0076fd@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   I think that it uses the R and G values for the grayscale value (and leaves
> B to 0), but I can't remember for sure.

It only does that for TGA output, for PNG it creates a 16-bit PNG.

It isn't very clearly documented, and I really don't think a lot of 
thought was put into the feature...the way it was done, one channel of 
the TGA file is wasted, ordinary TGA files are pretty unuseable for 
heightfields, and it doesn't fit in with the other global settings, it 
looks like it should be a command line and .ini option, like the other 
file output options.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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