POV-Ray : Newsgroups : povray.newusers : Defining colors from an image : Re: Defining colors from an image Server Time
28 Jul 2024 22:26:32 EDT (-0400)
  Re: Defining colors from an image  
From: OpalPlanet
Date: 3 Jul 2007 18:30:02
Message: <web.468acd0fad49873139928d3a0@news.povray.org>
That's awesome, thanks Warp!
-OpPl

Warp <war### [at] tagpovrayorg> wrote:
> 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.