POV-Ray : Newsgroups : povray.binaries.images : An experiment in monochrome : Re: An experiment in monochrome Server Time
6 Oct 2022 13:35:19 EDT (-0400)
  Re: An experiment in monochrome  
From: Bald Eagle
Date: 9 Jun 2021 14:30:00
Message: <web.60c1079d23b82ed51f9dae3025979125@news.povray.org>
Hi Matt,

> > "m@b" <sai### [at] googlemailcom> wrote:
> >> Trying to emulate mechanical shading.

This is clever!  I like it.  :)

> The image is put into a function:
> #declare MyTesti = function
> { pigment
>    { image_map
>      { "My image.png"  map_type 0
>        once
>      }
>      // scale <1,1,1>
>    }
> }
> (I am not sure where this function came from - I used it many years ago
> in another project.)

I see in your posted code that you comment that "map_type 0" is required - but
the docs say that this is the default planar mapping, so maybe it's not actually
a requirement?

> Each point on the image is interrogated and a sphere is drawn.
> The sphere is scaled by a constant in X and by brightness in Y.
> The sphere is rotated depending on the predominant colour: R, G, B or
> neutral. (Rotation must be a multiple of 45 degrees or the spheres don't
> join up to make a line.)
> The sphere is scaled to match the aspect of the input image.

I had this bouncing around in my head today,  and maybe it would be faster to
make some pigment patterns and use a pigment map instead of sphere primitives.


You could even just make a single linear pattern and the others would just be
rotations or scales of it. (have the line thickness be dependent on the color
channel value)

The other thing I was thinking was that you might also be able to get an outline
or shape-following effect if you calculated not only the value of any given
pixel, but the gradient of the function there as well.  Then you could make the
lines perpendicular to the gradient / tangent to the curve.

I know TOK wrote the gradient functions in the distributed include files, and
there are edge-finding algorithms that give you the gradient of the image as a

This looks like something super fun to play with, with a lot of potential for
future development!  Good work  :)

Post a reply to this message

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