picking pixel colors from one image

Mar 2, 2009 at 10:43pm

picking pixel colors from one image

Hi all,
i’m trying to do something easy yet i don’t know which is the best way to do that. I want to load a picture as color generator for further processing. How can i automatically get a color from a specific pixel of a picture? Suckah needs to have me clicking on the figure, or to have the figure visble, while i want also to hide it when i do other stuff. Ideally i’d like to tell my object the limits of the pictur and it randomly selects a pixel and detect the color and then moves to another one and so on.
Cheers
A

#42618
Mar 2, 2009 at 11:13pm

If you have jitter, you may want to try loading the image into a [jit.matrix] and using the “getcell” message.

#152582
Mar 3, 2009 at 4:12am
jestern@libero.it wrote on Mon, 02 March 2009 16:43
Hi all,
i’m trying to do something easy yet i don’t know which is the best way to do that. I want to load a picture as color generator for further processing. How can i automatically get a color from a specific pixel of a picture? Suckah needs to have me clicking on the figure, or to have the figure visble, while i want also to hide it when i do other stuff. Ideally i’d like to tell my object the limits of the pictur and it randomly selects a pixel and detect the color and then moves to another one and so on.
Cheers
A

As mentioned, you can use the [getcell] message to a jit.matrix where your image is, or if you don’t have Jitter, you can use the [suckah] by sending it a coordinate message (basically an “auto-click” which relieves you from actually clicking it). Using [counter] and/or [uzi] in combinations will let you get as many cells as you want, and with [pack] you can store the results in a table or coll. Note that you don’t have to have the suckah even over your image, or be visible, to send it screen coordinates to process. However you would need the image to be visible somewhere on the screen. If that’s an issue, do the jit.matrix option, plus you might have a look at jit.desktop.

#152583

You must be logged in to reply to this topic.