POV-Ray : Newsgroups : povray.newusers : Defining colors from an image : Re: Defining colors from an image Server Time
28 Jul 2024 22:29:49 EDT (-0400)
  Re: Defining colors from an image  
From: Warp
Date: 3 Jul 2007 17:18:09
Message: <468abd11@news.povray.org>
OpalPlanet <ecs### [at] msncom> wrote:
> Is there any way to take the color of a certain area of an image (jpeg, png,
> etc.) and find out its values in rgb?

  Perhaps a bit surprisingly, there is:

// The image will extend from <0, 0, 0> to <1, 1, 0>:
#declare Image = function { pigment { image_map { jpeg "SomeImage" } } };

#declare Pixel = Image(.5, .5, 0);

#debug concat("The value at <.5, .5> is <", vstr(3, Pixel, ", ", 0, 3), ">\n")

-- 
                                                          - Warp


Post a reply to this message

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