Connecting Tech Pros Worldwide Help | Site Map

getting pixel colors from an image?

Neraph
Guest
 
Posts: n/a
#1: Feb 14 '06
Sorry, I'm somewhat of a newbie at this.

I'm looking for a method of grabbing the color of a pixel when clicking
on an image (obviously, using javascript). Google searching hasn't
returned anything useful for me.

Thanks.
Paul Cooper
Guest
 
Posts: n/a
#2: Feb 14 '06

re: getting pixel colors from an image?


On Tue, 14 Feb 2006 10:58:10 -0500, Neraph <zach_blank@yahoo.com>
wrote:
[color=blue]
>Sorry, I'm somewhat of a newbie at this.
>
>I'm looking for a method of grabbing the color of a pixel when clicking
>on an image (obviously, using javascript). Google searching hasn't
>returned anything useful for me.
>
>Thanks.[/color]

I doubt it. Javascript doesn't have any access to the contents of an
image, only to the contents of the IMG tag. You could use the ISMAP
attribute and pass the image X,Y position to a client-side script that
would carry out the function, but I don't think you can do it in
Javascript.

Paul
Martin Honnen
Guest
 
Posts: n/a
#3: Feb 14 '06

re: getting pixel colors from an image?




Neraph wrote:
[color=blue]
> I'm looking for a method of grabbing the color of a pixel when clicking
> on an image (obviously, using javascript).[/color]

I am not sure there is a way achieving this with script in an HTML document.
There is a Mozilla extension color picker however that does this:
<http://www.iosart.com/firefox/colorzilla/>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#4: Feb 14 '06

re: getting pixel colors from an image?


Martin Honnen wrote:
[color=blue]
> Neraph wrote:[color=green]
>> I'm looking for a method of grabbing the color of a pixel when clicking
>> on an image (obviously, using javascript).[/color]
>
> I am not sure there is a way achieving this with script in an HTML
> document. There is a Mozilla extension color picker however that does
> this: <http://www.iosart.com/firefox/colorzilla/>[/color]

I had it installed already and I am sorry to report that it does not work
in Firefox 1.5.x on GNU/Linux: "Installation problem or the Eyedropper mode
isn't supported on your platform. [...]" (There was no installation error,
reinstall did not help, and I have the currently latest version 0.8.3.1.)


PointedEars
Closed Thread