POV-Ray : Newsgroups : povray.binaries.images : An experiment in monochrome Server Time
24 Apr 2024 07:08:49 EDT (-0400)
  An experiment in monochrome (Message 21 to 25 of 25)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: An experiment in monochrome
Date: 11 Jun 2021 18:45:00
Message: <web.60c3e71d23b82ed51f9dae3025979125@news.povray.org>
"m@b" <sai### [at] googlemailcom> wrote:

> I was over thinking, maybe this will work:
>
> #declare GreyTest = abs(TestR(X,Y,0)-TestG(X,Y,0)) +
> abs(TestR(X,Y,0)-TestB(X,Y,0)) + abs(TestB(X,Y,0)-TestG(X,Y,0));


I thought a bit about this, underthought it while playing with the idea, and
then realized that what I wanted to suggest was making use of the HSV color
space.

That way when all of the color channels are equal, the Hues cancel each other
out, or if they are close, then they give a small Saturation vector.  You can
then set the threshold and test the length of that Saturation vector.
Brightness would correspond to the Value.

Then you just use the CRGB2HSV color conversion macro in colors.inc (requires
CRGB2H).

// Converts a color in RGB color space to a color in HSV color space.
// Input:  < Red, Green, Blue, Filter, Transmit >
// Output: < Hue, Saturation, Value, Filter, Transmit >
#macro CRGB2HSV(Color)
   #local RGBFT = color Color;
   #local R = (RGBFT.red);
   #local G = (RGBFT.green);
   #local B = (RGBFT.blue);
   #local Min = min(R,min(G,B));
   #local Max = max(R,max(G,B));
   #local Span = Max-Min;
   #local H = CRGB2H (<R,G,B>, Max, Span);
   #local S = 0; #if (Max!=0) #local S = Span/Max; #end
   <H,S,Max,(RGBFT.filter),(RGBFT.transmit)>
#end


// Takes RGB vector, Max component, and Span as input,
// returns Hue value.
#macro CRGB2H (RGB, Max, Span)
   #local H = 0;
   #local R = RGB.red;
   #local G = RGB.green;
   #local B = RGB.blue;
   #if (Span>0)
      #local H = (
         + (R = Max & G != Max ? 0 + (G - B)/Span : 0)
         + (G = Max & B != Max ? 2 + (B - R)/Span : 0)
         + (B = Max & R != Max ? 4 + (R - G)/Span : 0)
      )*60;
   #end
   H
#end


Post a reply to this message

From: m@b
Subject: Re: An experiment in monochrome
Date: 14 Jun 2021 04:40:58
Message: <60c7161a@news.povray.org>
On 08/06/2021 11:21 am, m@b wrote:
> Trying to emulate mechanical shading.
> 
> m@

Here is an animated version with colour. Including the traditional 
checkered floor and blue sky:

<https://youtu.be/N2Z-DXoJBUY>

m@


Post a reply to this message

From: m@b
Subject: Re: An experiment in monochrome
Date: 18 Jun 2021 05:25:35
Message: <60cc668f@news.povray.org>
On 08/06/2021 11:21 am, m@b wrote:
> Trying to emulate mechanical shading.
> 
> m@

Latest:


Post a reply to this message


Attachments:
Download 'image cross hatch 04.png' (279 KB)

Preview of image 'image cross hatch 04.png'
image cross hatch 04.png


 

From: Thomas de Groot
Subject: Re: An experiment in monochrome
Date: 18 Jun 2021 07:15:46
Message: <60cc8062$1@news.povray.org>
Op 18-6-2021 om 11:25 schreef m@b:
> On 08/06/2021 11:21 am, m@b wrote:
>> Trying to emulate mechanical shading.
>>
>> m@
> 
> Latest:
> 
Oh yes! I prefer this one to those with different cross-hatches.

-- 
Thomas


Post a reply to this message

From: Mr
Subject: Re: An experiment in monochrome
Date: 18 Jun 2021 07:20:00
Message: <web.60cc80e523b82ed56adeaecb3f378f2@news.povray.org>
"m@b" <sai### [at] googlemailcom> wrote:
> On 08/06/2021 11:21 am, m@b wrote:
> > Trying to emulate mechanical shading.
> >
> > m@
>
> Latest:

The technique refines ! result looks excellent !


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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