POV-Ray : Newsgroups : povray.general : Photoshop Question (needed for texture) Server Time
22 Dec 2024 18:15:14 EST (-0500)
  Photoshop Question (needed for texture) (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Sven Littkowski
Subject: Photoshop Question (needed for texture)
Date: 29 Jul 2017 03:39:48
Message: <597c3bc4$1@news.povray.org>
Is anyone here who uses Photoshop? I have a question in regards to the
texture of my current POV-Ray project.

Is there a way in Photoshop (I use the older 7 version) to get the
average color of a selected image area? Maybe even to colorize that
selected image area with that average color? A plugin?

Example: I selected an area within a photo (a rectangular marquee), that
shows many items in bright yellow, and a few items in orange. The
average color would be a warm slightly orangish yellow...
Ideally, there would be also a way to replace all contents of that
selected photo area with just that color alone, resulting in a
warm-yellow rectangle.

Any advises for a plugin or procedure?

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Kenneth
Subject: Re: Photoshop Question (needed for texture)
Date: 29 Jul 2017 14:20:03
Message: <web.597cd0c5f28314b883fb31c0@news.povray.org>
Would you believe that I *just* wrote such a macro, in POV-ray itself?!
(Photoshop isn't required.) I made it for my 'city building' generator-- and had
planned to post it, but got side-tracked. It does exactly what you need: finding
the overall average color from the many colors in an image_map.

Give me a day to double-check the code, and I'll post it ASAP. Can't do it
today; I'm temporarily too busy with 'real life'...  :-/


Post a reply to this message

From: Kenneth
Subject: Re: Photoshop Question (needed for texture)
Date: 29 Jul 2017 14:45:01
Message: <web.597cd673f28314b883fb31c0@news.povray.org>
As an experiment (in Photoshop)  you might try using *heavy* Gaussian Blur on
the image-- so that it's completely blurred-out--then finding the color of a
pixel somewhere near the center of the image. I don't know if this would work
accurately, as I've never tried it.


Post a reply to this message

From: Sven Littkowski
Subject: Re: Photoshop Question (needed for texture)
Date: 30 Jul 2017 05:49:43
Message: <597dabb7@news.povray.org>
On 29.07.2017 14:39, Kenneth wrote:
> As an experiment (in Photoshop)  you might try using *heavy* Gaussian Blur on
> the image-- so that it's completely blurred-out--then finding the color of a
> pixel somewhere near the center of the image. I don't know if this would work
> accurately, as I've never tried it.
> 
> 
> 
> 
No, these two options would not work for me.
1
Gaussian Blur, even within a marquee (selection) would still catch color
from the neighboring areas, I already tried it.
2
I need this on an image, true. But the marquees (selections) are not
square, but like a pie-piece. And all are also different from each
other. I really need a Photoshop solution. I really wished, I could use
your POV-Ray macro.
I need it for the latest version of my "Question: Bump Not Showing"
balloon texture file, inside the IMAGES group here. I am posting that
texture file as very last posting within that thread, using your name
inside the posting thread. When looking at that texture file, you will
see the dark borders within. And I need a color averaging for each field
of that texture.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Stephen
Subject: Re: Photoshop Question (needed for texture)
Date: 30 Jul 2017 07:20:20
Message: <597dc0f4$1@news.povray.org>
On 7/30/2017 10:49 AM, Sven Littkowski wrote:
> I need it for the latest version of my "Question: Bump Not Showing"
> balloon texture file, inside the IMAGES group here. I am posting that
> texture file as very last posting within that thread, using your name
> inside the posting thread. When looking at that texture file, you will
> see the dark borders within. And I need a color averaging for each field
> of that texture.

I looked at the image you posted. It looks completely black. 
PaintShopPro tells me that there are 6 unique colours in it. I can see 
no detail in it at all. Even after adjusting brightness, contrast etc.
Now when I used an edge enhance function three times I did get a result. 
I's very faint.

-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: Photoshop Question (needed for texture)
Date: 31 Jul 2017 08:05:00
Message: <web.597f1caef28314bc437ac910@news.povray.org>
Maybe if you just use eval pigment to sample all the rgb values, average them
and then place a box at that point, using only povray.

Sorry I don't have too much more - I'm at work  ;)


Post a reply to this message

From: Bald Eagle
Subject: Re: Photoshop Question (needed for texture)
Date: 31 Jul 2017 15:20:01
Message: <web.597f8270f28314bc437ac910@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Maybe if you just use eval pigment to sample all the rgb values, average them
> and then place a box at that point, using only povray.


#version 3.71
global_settings {
 assumed_gamma 1.0
}

// example scene to average pigment values in a box
// x and y ranges are -0.5 to 0.5
// Bill Walker "Bald Eagle"  2017

#include "colors.inc"
#include "functions.inc"
#include "rand.inc"

camera {
  orthographic
  location <0,0,-1>    // position & direction of view
  look_at  <0,0,0>
  right 1*x            // horizontal size of view
  up 1*y               // vertical size of view
}

#declare Rseed = seed (123);
#declare Gseed = seed (456);
#declare Bseed = seed (789);

#declare Pig =
    pigment {
     cells
     color_map {
      #for (E, 0, 1, 0.1)
       #local R = rand (Rseed);
       #local G = rand (Gseed);
       #local B = rand (Bseed);
       [E  color red R green G blue B]
    #end // end for E
   } // color_map
   scale 0.01
    } // end pigment



box {                  // this box fits exactly in view
 <-0.5, -0.5, 0>, <0.5, 0.5, 0>
 pigment {Pig}
} // end box

#declare YS = 1/image_height;
#declare XS = 1/image_width;

#declare ymin =  0.12;
#declare ymax =  0.25;
#declare xmin = -0.11;
#declare xmax =  0.15;

#declare AVG = 0;
#for (Y, ymin, ymax, YS)
 #for (X, xmin, xmax, XS)
  #declare Shade = eval_pigment (Pig, <X, Y, 0>);
  #declare AVG = AVG + Shade;
 #end // end for X
#end // end for Y
#declare AVG = AVG / ( ((xmax-xmin)/XS) * ((ymax-ymin)/YS) );

box {                  // this box fits exactly in view
 <xmin, ymin, -0.01>, <xmax, ymax, -0.01>
 texture {pigment {color rgb AVG}}
} // end box


Gives a gray box over the "cells" pattern.
I'm aware of the redundancy of generating the random colors for the cells
pattern - but I wanted that code block in there with the color map...


Post a reply to this message

From: Sven Littkowski
Subject: Re: Photoshop Question (needed for texture)
Date: 31 Jul 2017 19:43:16
Message: <597fc094$1@news.povray.org>
On 31.07.2017 15:18, Bald Eagle wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
>> Maybe if you just use eval pigment to sample all the rgb values, average
 them
>> and then place a box at that point, using only povray.
> 
> 
> #version 3.71
> global_settings {
>  assumed_gamma 1.0
> }
> 
> // example scene to average pigment values in a box
> // x and y ranges are -0.5 to 0.5
> // Bill Walker "Bald Eagle"  2017
> 
> #include "colors.inc"
> #include "functions.inc"
> #include "rand.inc"
> 
> camera {
>   orthographic
>   location <0,0,-1>    // position & direction of view
>   look_at  <0,0,0>
>   right 1*x            // horizontal size of view
>   up 1*y               // vertical size of view
> }
> 
> #declare Rseed = seed (123);
> #declare Gseed = seed (456);
> #declare Bseed = seed (789);
> 
> #declare Pig =
>     pigment {
>      cells
>      color_map {
>       #for (E, 0, 1, 0.1)
>        #local R = rand (Rseed);
>        #local G = rand (Gseed);
>        #local B = rand (Bseed);
>        [E  color red R green G blue B]
>     #end // end for E
>    } // color_map
>    scale 0.01
>     } // end pigment
> 
> 
> 
> box {                  // this box fits exactly in view
>  <-0.5, -0.5, 0>, <0.5, 0.5, 0>
>  pigment {Pig}
> } // end box
> 
> #declare YS = 1/image_height;
> #declare XS = 1/image_width;
> 
> #declare ymin =  0.12;
> #declare ymax =  0.25;
> #declare xmin = -0.11;
> #declare xmax =  0.15;
> 
> #declare AVG = 0;
> #for (Y, ymin, ymax, YS)
>  #for (X, xmin, xmax, XS)
>   #declare Shade = eval_pigment (Pig, <X, Y, 0>);
>   #declare AVG = AVG + Shade;
>  #end // end for X
> #end // end for Y
> #declare AVG = AVG / ( ((xmax-xmin)/XS) * ((ymax-ymin)/YS) );
> 
> box {                  // this box fits exactly in view
>  <xmin, ymin, -0.01>, <xmax, ymax, -0.01>
>  texture {pigment {color rgb AVG}}
> } // end box
> 
> 
> Gives a gray box over the "cells" pattern.
> I'm aware of the redundancy of generating the random colors for the cells

> pattern - but I wanted that code block in there with the color map...
> 
> 
> 
> 
Thanks. Actually, there is a related thread inside the IMAGE group,
there you can see the texture file and its many pie-shaped areas, which
I want to transform to the individual average color of each section.

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: omniverse
Subject: Re: Photoshop Question (needed for texture)
Date: 1 Aug 2017 00:45:01
Message: <web.5980069af28314b9c5d6c810@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > Maybe if you just use eval pigment to sample all the rgb values, average them
> > and then place a box at that point, using only povray.
>
> // example scene to average pigment values in a box
> // x and y ranges are -0.5 to 0.5
> // Bill Walker "Bald Eagle"  2017

--->8---

> #declare Rseed = seed (123);
> #declare Gseed = seed (456);
> #declare Bseed = seed (789);
>
> #declare Pig =
>     pigment {
>      cells
>      color_map {
>       #for (E, 0, 1, 0.1)
>        #local R = rand (Rseed);
>        #local G = rand (Gseed);
>        #local B = rand (Bseed);
>        [E  color red R green G blue B]
>     #end // end for E
>    } // color_map
>    scale 0.01
>     } // end pigment
>
>
>
> box {                  // this box fits exactly in view
>  <-0.5, -0.5, 0>, <0.5, 0.5, 0>
>  pigment {Pig}
> } // end box
>
> #declare YS = 1/image_height;
> #declare XS = 1/image_width;
>
> #declare ymin =  0.12;
> #declare ymax =  0.25;
> #declare xmin = -0.11;
> #declare xmax =  0.15;
>
> #declare AVG = 0;
> #for (Y, ymin, ymax, YS)
>  #for (X, xmin, xmax, XS)
>   #declare Shade = eval_pigment (Pig, <X, Y, 0>);
>   #declare AVG = AVG + Shade;
>  #end // end for X
> #end // end for Y
> #declare AVG = AVG / ( ((xmax-xmin)/XS) * ((ymax-ymin)/YS) );
>
> box {                  // this box fits exactly in view
>  <xmin, ymin, -0.01>, <xmax, ymax, -0.01>
>  texture {pigment {color rgb AVG}}
> } // end box
>
>
> Gives a gray box over the "cells" pattern.
> I'm aware of the redundancy of generating the random colors for the cells
> pattern - but I wanted that code block in there with the color map...

That's a nifty way of going about it, even if I can't think of a way to use it
for myself someone might. Good work.

Bob


Post a reply to this message

From: Sven Littkowski
Subject: Re: Photoshop Question (needed for texture)
Date: 1 Aug 2017 21:12:10
Message: <598126ea$1@news.povray.org>
I went to a place where a newer version of Photoshop is installed, and
got what I wanted. Thanks to everyone!

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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