Color missmatch with VNC library (vernacular)

25 Views Asked by At

In my web application I have to implement VNC viewer. Server side is in Java and I choose to use vernacular vnc library. It looks very simple to use. My VNC server is (Info from Real VNC-> VNC Server default: depth 32 (32bpp) big-endian rgb mac 255,255,255 shift 0,8,16 ; requested encoding ZRLE2 ; size: 800x600)

In java application I specified pixel format: BPP_32_TRUE(32, 32, true, 255, 255, 255, 0, 8, 16).

but I am getting color missmatch. I tried with all combinatons of three color shift but without luck.

config = new VernacularConfig();
client = new VernacularClient(config);
        
config.setErrorListener(Throwable::printStackTrace);
        
config.setColorDepth(ColorDepth.BPP_32_TRUE);
 
config.setEnableCopyrectEncoding(true);
config.setEnableHextileEncoding(true);
config.setEnableRreEncoding(true);
config.setEnableZLibEncoding(true);


config.setScreenUpdateListener(image -> {
   try{
        BufferedImage bufferedImage = (BufferedImage) (image);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ImageIO.write(image, "png", baos);
        screen_base64_img = Base64.getEncoder().encodeToString(baos.toByteArray());
                
    }catch (Exception e) {
    }

I don't know where it can be a problem. How to fix vernacular library

Can someone help me. Thank you.

0

There are 0 best solutions below