Posted by
Juanjo Vega on
May 25, 2011; 10:09am
URL: http://imagej.273.s1.nabble.com/How-to-work-with-color-images-tp3684447.html
Hello everyone,
I need to work with colour images in a plugin I'm developing, and as it is my first time and I'm pretty confused.
I had a look into the "Color Threshold" plugin and found this:
int c, r, g, b;
...
c=ip.getPixel(x,y);
r = ((c&0xff0000)>>16);//R
g = ((c&0x00ff00)>>8);//G
b = ( c&0x0000ff); //B
So, do I have to convert every pixel like that before working with them? Is there no API for RGB images? Maybe a method to split the image in three different gray scale images and to merge them after being processed, would be helpful.
Any help will he welcome, plugins, API reference, etc. :)
Sincerely,
Juanjo.
------------------------------------------------------------
Juanjo Vega (
[hidden email])
Unidad de Biocomputación. Laboratorio B-13.
Centro Nacional de Biotecnología. CNB-CSIC.
C\ Darwin, 3. Campus de Cantoblanco.
Universidad Autónoma de Madrid.
28049, Madrid, Spain.
http://www.cnb.csic.eshttp://www.biocomp.cnb.csic.es+34 91 585 4510
"Las mejores almas son capaces de los mayores vicios como de las mayores
virtudes, y aquellos que caminan despacio por el camino recto pueden
llegar más lejos que los que corren pero se apartan de él." - Discurso
del Método, René Descartes.