Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (anonymous):

I'm trying to make a grayscale image. The values that I want to set Red, Green, and Blue are 27. But when I set it them all to 27 manually. It just turns out to become an entirely grey image, but how come this code works? image = new SimpleImage("liberty-red.jpg"); for (pixel: image) { pixel.setGreen(pixel.getRed()); pixel.setBlue(pixel.getRed()); } print(image);

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!