Free Support Forum -

While drawing Image in Graphics resolution is not preserved

URL url = new URL(appModel.getScreenshots()[5]);
            InputStream inputStream = url.openStream();
            BufferedImage image =;
            //FileInputStream inputStream = new FileInputStream(dataDir + playstoreBody.getNewImageName());
            Layer newLayer = new Layer(inputStream);
            Graphics graphics = new Graphics(scrshotLayer);
            graphics.drawImage(newLayer, new Rectangle(new Point(), new Size(scrshotLayer.getWidth(), scrshotLayer.getHeight())));

Resolution of image which I am drawing in last line is not getting preserved and as a result getting image compressed. Is there any way to preserve resolution. Here I am reading image from URL.


I request you to please provide the source and generated image that we can observe and verify on our end to help you further.