This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
school-projects/src/main/java/io/gitlab/jfronny/ImgJava/imageProcessing/UtilColor.java

26 lines
678 B
Java

package io.gitlab.jfronny.ImgJava.imageProcessing;
import io.gitlab.jfronny.ImgJava.util.MColor;
import io.gitlab.jfronny.ImgJava.util.Picture;
import java.awt.*;
public class UtilColor {
public static Picture tint(Picture picture, Color tint) {
int w = picture.getWidth();
int h = picture.getHeight();
Color[][] pixel = picture.getPixelArray();
Color[][] pixelNeu = new Color[w][h];
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
pixelNeu[x][y] = new MColor(pixel[x][y]).tint(tint).get();
}
}
picture.setPixelArray(pixelNeu);
return picture;
}
}