Hi, I'm new to java and I'm trying to get my program to run where it takes one photo of me at a green screen and then substitutes it for another background.

I have all the code that grabs the pictures but I cant quite get it to work correctly. My code so far is as follows;


Code:
public class DIP {
public static void chromakey(Picture p1, Picture p2){
		for( int i = 0, j = p1.getHeight()-1; i < p1.getWidth();
...