I need help with this plz
Old-fashioned photographs from the 19th century are not quite black and white and not quite color, but seem to have shades of gray, brown, and blue. This effect is called sepia. Define and test a function named sepia that converts a color image to sepia. This function first calls the grayscale function to convert the color image to grayscale. Here is a code segment for then transforming the color component value of a single pixel to achieve a sepia effect. Note that the value for green does not change.
import images.APImage; import images.Pixel; import java.util.Scanner; public class jm54{ public static void main(String[]args){ Scanner reader = new Scanner(System.in); APImage image = new APImage("smokey.jpg"); image.draw(); for (Pixel p: image){ int red = p.getRed(); int green = p.getGreen(); int blue = p.getBlue(); int average = (red + green + blue) / 3; p.setRed (average); p.setGreen(average); p.setBlue(average); if (red < 63){ red = (int)(red * 1.1); blue = (int)(blue * 0.9); }else if (red < 192){ red = (int)(red * 1.15); blue = (int)(blue * 0.85); }else{ red = Math.min(int(red * 1.08), 255); blue = (int)(blue * 0.93); } } // System.out.print("Press return to continue:"); // reader.nextLine(); image.draw(); } }