html
php
iphone
python
mysql
xcode
android
ruby-on-rails
objective-c
visual-studio
html5
oracle
tsql
apache
php5
api
jsp
postgresql
dom
If you look at the documentation for getPixel(int,int) in ImagePlus you'll see that it returns an array of ints rather than a single int:
getPixel(int,int)
ImagePlus
int
Returns the pixel value at (x,y) as a 4 element array. Grayscale values are retuned in the first element. RGB values are returned in the first 3 elements. For indexed color images, the RGB values are returned in the first 3 three elements and the index (0-255) is returned in the last.
It looks as if you're dealing with an RGB image, so you should be able to do the following instead:
int [] colorArray = image1.getPixel(x,y); int redValue = colorArray[0]; int greenValue = colorArray[1]; int blueValue = colorArray[2];