package plugin.basic;

import java.awt.*;
import java.awt.Color;
import java.awt.image.BufferedImage;

import plugin.IPlugin;

public class Green implements IPlugin {

    @Override
    public BufferedImage perform(BufferedImage img) {
        BufferedImage res = new BufferedImage(img.getWidth(), img.getHeight(), img.getType());

        for (int i = 0; i < img.getWidth(); i++)
            for (int j = 0; j < img.getHeight(); j++) {
                Color c = new Color(img.getRGB(i, j));
                c = new Color(0, c.getGreen(), 0);
                res.setRGB(i, j, c.getRGB());
            }
        return res;
    }

    @Override
    public String getName() {
        return "Only Green";
    }

}