How do i hange the rgb value of a specific pixel?
GreenfootImage image = getImage(); // get image Color color = image.getColorAt(0, 0); // get color at some location int red= color.getRed();; // get red of color int green = color.getGreen();; // get green of color int blue = color.getBlue(); // get bue of color // adjust red/blue/green values here /** example -- removing red */ red = 0; /** **************** */ color = new Color(red, green, blue); // create new color using adjusted rgb values image.setColorAt(0, 0, color); // set adjusted color to same location
GreenfootImage image = getImage(); // get image Color color = image.getColorAt(0, 0); // get color at some location int red= color.getRed();; // get red of color int green = color.getGreen();; // get green of color int blue = color.getBlue(); // get bue of color // adjust red/blue/green values here /** example -- removing red */ red = 0; /** **************** */ color = new Color(red, green, blue); // create new color using adjusted rgb values image.setColorAt(0, 0, color); // set adjusted color to same location