to jest moj kod:
package org.example.bitmap;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

public class HelloApplication extends Application {

    private BytesTools bytesTools = BytesTools.getINSTANCE();

    private static final float RESOLUTION = 2f;

    @Override
    public void start(Stage stage) throws IOException {

        File file = new File("../images/picture.bmp");

        byte[] header = new byte[14];
        byte[] dib_headerSize = new byte[4];
        byte[] dib_header = new byte[40];

        int width, heigth, bPp; //bytes per pixel

        Group root = new Group();

        try {
            BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(file));

            bufferedInputStream.read(header);
            bufferedInputStream.read(dib_headerSize);
            bufferedInputStream.read(dib_header);

            width = bytesTools.calcWidth(dib_header);
            heigth = bytesTools.calcHeight(dib_header);

            bPp = Integer.decode(bytesTools.bytesToString(bytesTools.toBigEndian(dib_header, 10, 12))) / 8;

            byte[] pixel = new byte[bPp];

            int x = 0;
            int y = heigth;

            while((bufferedInputStream.read(pixel)) != -1){
                if(x%RESOLUTION == 0){
                    if(!isWhite(pixel)){
                        Rectangle rectangle = new Rectangle(1, 1);
                        rectangle.setX(x/RESOLUTION);
                        rectangle.setY(y/RESOLUTION);
                        bytesTools.showBytes(pixel);

                        rectangle.setFill(Color.color(Byte.toUnsignedInt(pixel[1])/255f, Byte.toUnsignedInt(pixel[0])/255f, Byte.toUnsignedInt(pixel[2])/255f));
                        root.getChildren().add(rectangle);
                    }
                }
                ++x;

                if(x == width){
                    --y;
                    x=0;
                }
            }

        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        Scene scene = new Scene(root, width/RESOLUTION, heigth/RESOLUTION);

        stage.setTitle("PictureTool");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }

    private static boolean isWhite(byte[] pixel){
        for(byte var : pixel){
            if(Byte.toUnsignedInt(var) != 255){
                return false;
            }
        }
        return true;
    }
}
package org.example.bitmap;

public class BytesTools {

    private static final BytesTools INSTANCE = new BytesTools();

    private BytesTools(){}

    public int calcWidth(byte[] bytes){return Integer.decode(bytesToString(toBigEndian(bytes, 0, 4)));}

    public int calcHeight(byte[] bytes){return Integer.decode(bytesToString(toBigEndian(bytes, 4, 8)));}

    public byte[] toBigEndian(byte[] bytes, int start, int end){
        byte[] bigEndian = new byte[end-start];

        for(int i = start; i<end; ++i){
            bigEndian[(end-1) - i] = bytes[i];
        }

        return bigEndian;
    }

    public String bytesToString(byte[] bytes){
        String Sbytes = "0x";

        for(int i = 0; i<bytes.length; ++i){
            Sbytes += String.format("%02X", bytes[i]);
        }

        return Sbytes;
    }

    public void showBytes(byte[] bytes){
        System.out.print("\nByte: ");
        for(byte value : bytes){
            System.out.print(Byte.toUnsignedInt(value));
            System.out.print(", ");
        }
    }

    public static BytesTools getINSTANCE() {
        return INSTANCE;
    }
}