import princeton.introcs.Picture; import java.awt.Color; public class RedEye { public static void main(String[] args) { Picture pic = new Picture("redeye.jpg"); int wid = pic.width(); int ht = pic.height(); for (int i = 0; i < wid; i++) { for (int j = 0; j < ht; j++) { Color col = pic.get(i, j); int red = col.getRed(); int green = col.getGreen(); int blue = col.getBlue(); if ((double) red / (green + blue) > 1) { Color replace = new Color(0, green, blue); pic.set(i, j, replace); } } } pic.show(); } }