Мой автор изображений:
Код: Выделить всё
public ImageProcessor() {
width = 1;
height = 1;
image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
monochromeImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
pixels = new ArrayList();
}
// process image given its path
public void process(String path) {
try {
this.image = ImageIO.read(new File(path));
width = this.image.getWidth();
height = this.image.getHeight();
this.monochromeImage = new BufferedImage(this.width, this.height, BufferedImage.TYPE_BYTE_GRAY);
pixels.clear();
for (int y = 0; y < this.monochromeImage.getHeight(); ++y) {
pixels.add(new ArrayList());
for (int x = 0; x < this.width; ++x) {
int rgb = this.image.getRGB(x, y);
int grayValue = (int) (0.299 * ((rgb >> 16) & 0xFF) + 0.587 * ((rgb >> 8) & 0xFF) + 0.114 * (rgb & 0xFF));
this.monochromeImage.setRGB(x, y, (grayValue
Подробнее здесь: [url]https://stackoverflow.com/questions/78480263/why-wont-my-javafx-imageview-show-any-images[/url]