get() pixel colour without displaying image
in
Programming Questions
•
1 year ago
In this little bit of code I experimented with get(x, y):
PImage someImage;
void setup()
{
size(100, 155);
background(192);
noLoop();
someImage = loadImage(" http://processing.org/img/learning/books/getting-started-with-processing-sm.jpg");
}
{
size(100, 155);
background(192);
noLoop();
someImage = loadImage(" http://processing.org/img/learning/books/getting-started-with-processing-sm.jpg");
}
void draw()
{
// image(someImage, 0, 0, 50, 77); //red value is red(background)
image(someImage, 0, 0); //red value is 238
//if I comment both out, I get the value of the background colour
println(red(get(55, 100)));
}
{
// image(someImage, 0, 0, 50, 77); //red value is red(background)
image(someImage, 0, 0); //red value is 238
//if I comment both out, I get the value of the background colour
println(red(get(55, 100)));
}
Can I find the colour of a pixel in an image without displaying the image?
1