POV-Ray : Newsgroups : povray.general : Rendering part of an image in black and white Server Time
4 Aug 2024 02:18:45 EDT (-0400)
  Rendering part of an image in black and white (Message 1 to 4 of 4)  
From: Kaveh Bazargan
Subject: Rendering part of an image in black and white
Date: 26 Aug 2003 05:30:53
Message: <kaveh1000-7C8313.10305126082003@netplex.aussie.org>
I have a particular project for which I need to render a scene in black 
and white. Ideally, I need a filter (like a photographic filter) which 
shows a scene in black and white when we look through it. 

So imagine a rendered scene which is in full color, except a part of it 
which is scene through a special glass filter which is held up.

I looked at the archives and the nearest solution I can find is to use 
hf_gray_16 in the global settings, and re-import that to somehow 
generate a black and white scene:

http://news.povray.org/povray.general/1150/

Is there any other method I can use to do this in a single render?

--
Kaveh


Post a reply to this message

From: ABX
Subject: Re: Rendering part of an image in black and white
Date: 26 Aug 2003 06:40:34
Message: <7hdmkvsdtnoqc06ut5rld340q39njfonh5@4ax.com>
On Tue, 26 Aug 2003 10:30:53 +0100, Kaveh Bazargan <kav### [at] maccom> wrote:
> So imagine a rendered scene which is in full color, except a part of it 
> which is scene through a special glass filter which is held up.

1. Render your scene in color into image.png.
2. Render your mask.png with area of glass filter as white and rest in black.
3. Create scene like:

  #version 3.5;
  global_settings{assumed_gamma 1.0}
  #include "screen.inc" /* http://www.povray.org/documentation/view/288/ */
  #declare Image=pigment{image_map{"image.png"}};
  #declare f_Image=function{pigment{Image}};
  #declare Processed=texture{
    pigment{
      image_pattern{"mask.png}
      pigment_map{
        [0 Image]
        [1 function{f_Image(x,y,z).gray}]
      }
    }
    finish{ambient 1 diffuse 0}
  }
  Screen_Plane(Processed, 1, 0, 1)

not tested but should work the way I understand your problem.

ABX


Post a reply to this message

From: Kaveh
Subject: Re: Rendering part of an image in black and white
Date: 26 Aug 2003 06:51:06
Message: <kaveh-6F75AE.11510526082003@netplex.aussie.org>
In article <7hdmkvsdtnoqc06ut5rld340q39njfonh5@4ax.com>,
 ABX <abx### [at] abxartpl> wrote:

> On Tue, 26 Aug 2003 10:30:53 +0100, Kaveh Bazargan <kav### [at] maccom> wrote:
> > So imagine a rendered scene which is in full color, except a part of it 
> > which is scene through a special glass filter which is held up.
> 
> 1. Render your scene in color into image.png.
> 2. Render your mask.png with area of glass filter as white and rest in black.
> 3. Create scene like:
> 
>   #version 3.5;
>   global_settings{assumed_gamma 1.0}
>   #include "screen.inc" /* http://www.povray.org/documentation/view/288/ */
>   #declare Image=pigment{image_map{"image.png"}};
>   #declare f_Image=function{pigment{Image}};
>   #declare Processed=texture{
>     pigment{
>       image_pattern{"mask.png}
>       pigment_map{
>         [0 Image]
>         [1 function{f_Image(x,y,z).gray}]
>       }
>     }
>     finish{ambient 1 diffuse 0}
>   }
>   Screen_Plane(Processed, 1, 0, 1)
> 
> not tested but should work the way I understand your problem.

Thanks very much for taking the time to write this. Plenty of new stuff 
for me to learn here. 

Can I just confirm, this needs two renderings, one to create the first 
png, another to map it onto the 'screen'. Any possibility of a single 
render?

-- 
Kaveh


Post a reply to this message

From: ABX
Subject: Re: Rendering part of an image in black and white
Date: 26 Aug 2003 07:01:47
Message: <r5fmkvobr2og1duds82hrqa8dh9calnpt5@4ax.com>
On Tue, 26 Aug 2003 11:51:05 +0100, Kaveh
<kav### [at] delete_this_bitfocalimagecom> wrote:
> Thanks very much for taking the time to write this. Plenty of new stuff 
> for me to learn here. 

Have a good time with it :-)

> Can I just confirm, this needs two renderings, one to create the first 
> png, another to map it onto the 'screen'. Any possibility of a single 
> render?

In fact the way I did it it needs three renderings: image, mask, combination
of image and mask. You don't have to create mask into separate image so you
can do it in two renderings too. mask can be any function which returns floats
gray values within area <0,0,0>-<1,1,0>. To have single process you can use
POST_SCENE_COMMAND and/or POST_FRAME_COMMAND ini options - see manual. In
MegaPOV 1.1 it will be possible to make everything in single render but
MegaPOV 1.1 has to wait with release :-(

ABX


Post a reply to this message

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