setPixel and getPixel for RBG images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

setPixel and getPixel for RBG images

YuriGagarine
Hi all,

I want to know if there are functions as setPixel and getPixel for RGB images. Sorry if it is a dumb question, but I looked everywhere.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: setPixel and getPixel for RBG images

Krs5
Dear Yuri,

Assuming you talk about macro functions you can have a look at the example: http://imagej.nih.gov/ij/macros/tools/ColorPickerTool.txt to see how to deal with RGB images

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif




-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of YuriGagarine
Sent: 08 April 2014 13:30
To: [hidden email]
Subject: setPixel and getPixel for RBG images

Hi all,

I want to know if there are functions as setPixel and getPixel for RGB images. Sorry if it is a dumb question, but I looked everywhere.

Thanks in advance.



--
View this message in context: http://imagej.1557.x6.nabble.com/setPixel-and-getPixel-for-RBG-images-tp5007241.html
Sent from the ImageJ mailing list archive at Nabble.com.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: setPixel and getPixel for RBG images

Herbie-3
In reply to this post by YuriGagarine
Good day Yuri Gagarine,

the "Built-in Macro Functions"-Doc tells us:

"getPixel(x, y) Returns the value of the pixel at (x,y). Note that
pixels in RGB images contain red, green and blue components that need to
be extracted using shifting and masking. [...]"

The accompanying example tells us:

"v = getPixel(x,y);
red = (v>>16)&0xff;  // extract red byte (bits 23-17)
green = (v>>8)&0xff; // extract green byte (bits 15-8)
blue = v&0xff;       // extract blue byte (bits 7-0)"

HTH

Herbie

::::::::::::::::::::::::::::::::::::::
On 08.04.14 14:29, YuriGagarine wrote:

> Hi all,
>
> I want to know if there are functions as setPixel and getPixel for RGB
> images. Sorry if it is a dumb question, but I looked everywhere.
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/setPixel-and-getPixel-for-RBG-images-tp5007241.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html