|
|
Adrien Beau <adr### [at] freefr> wrote:
: I am not sure that if you convert 24-bit to greyscale
: you will get 16-bit precision : I would say 8-bit, but I'm
: not at all into this field, so I'm not sure at all.
When you convert an image to b/w (and save it to a true-color 24-bit
format) you get exactly 256 different shades of gray. POV-Ray can only
create 256 heights from them.
Using red+green as a 16-bit value for the height is a good idea, but not
very practical. No image editing programs support that, so you just can't
create them. AFAIK there are only two widespread programs which support
this: POV-Ray and fracting. This isn't enough because neither is an image
editing program.
Nowadays this red+green idea is also obsolete because we can use a 16-bit
b/w PNG to achieve the same thing, and this is a lot more supported (besides
being a lot more logical).
: I'm a bit confused about the issue of B&W conversion. Are you
: sure you will have more than 8-bit precision in that case?
Yes. You get approximately 3 times more accuracy.
There's a big difference between converting an image first to b/w and
then feeding the result to POV-Ray and feeding the original color image
and letting POV-Ray do the b/w conversion. The difference is that when
you do the b/w conversion yourself and save to an image format, you are
actually *clamping* the fraction values from the result, thus destroying
accuracy.
Suppose that a simple average is used to make the b/w-conversion. This
table shows what I mean:
Original B/W value What actually gets
rgb values (which pov could use) written to an image file
---------- --------------------- ------------------------
0,0,0 0 0
1,0,0 1/3 0
1,1,0 2/3 1
1,1,1 1 1
2,1,1 4/3 1
2,2,1 5/3 2
2,2,2 2 2
etc.
(Note that the order of the example rgb values above doesn't matter.)
If we let POV-Ray do the b/w-conversion, then it can use 3 times more
accuracy than if we save to b/w-converted image to a file and give that
to POV-Ray.
--
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}// - Warp -
Post a reply to this message
|
|