Filter to improve image in Java
I need to create a filter for scanning an image in a java program, the filter you need is to correct the image visualization if algier knows a library to do this, it would be helpful.
The code is as follows:

         @Override
        public void paint(Graphics g) {
            super.paint(g);

            int panelWidth = getWidth() - 6;
            int panelHeight = getHeight() - 6;
            double horizontalRatio = (double) panelWidth / imageWidth;
            double verticalRatio = (double) panelHeight / imageHeight;
            if (horizontalRatio > verticalRatio) {
                g.drawImage(image, (int) ((panelWidth - imageWidth * verticalRatio) / 2 + 3)* + x, 3 + y,
                        (int) ((imageWidth * verticalRatio) + (imageWidth * verticalRatio * zoom)), (int) ((imageHeight * verticalRatio) + (imageHeight * verticalRatio * zoom)), this);
            } else {
                //AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC);
                g.drawImage(image, x, y, (int) ((imageWidth * horizontalRatio) + (imageWidth * horizontalRatio * zoom)), (int) ((imageHeight * horizontalRatio) + (imageHeight * horizontalRatio * zoom)), this);
               // g.setColor(Color.RED);           
               // BufferedImage buffImg = new BufferedImage(imageWidth, imageHeight,BufferedImage.TYPE_INT_ARGB);
               // Graphics2D gbi = buffImg.createGraphics();
               // gbi.setComposite(ac);

            }
        }
Filter to improve image in Java
===

I need to create a filter for scanning an image in a java program, the filter you need is to correct the image visualization if algier knows a library to do this, it would be helpful.
The code is as follows:

         @Override
        public void paint(Graphics g) {
            super.paint(g);

            int panelWidth = getWidth() - 6;
            int panelHeight = getHeight() - 6;
            double horizontalRatio = (double) panelWidth / imageWidth;
            double verticalRatio = (double) panelHeight / imageHeight;
            if (horizontalRatio > verticalRatio) {
                g.drawImage(image, (int) ((panelWidth - imageWidth * verticalRatio) / 2 + 3)* + x, 3 + y,
                        (int) ((imageWidth * verticalRatio) + (imageWidth * verticalRatio * zoom)), (int) ((imageHeight * verticalRatio) + (imageHeight * verticalRatio * zoom)), this);
            } else {
                //AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC);
                g.drawImage(image, x, y, (int) ((imageWidth * horizontalRatio) + (imageWidth * horizontalRatio * zoom)), (int) ((imageHeight * horizontalRatio) + (imageHeight * horizontalRatio * zoom)), this);
               // g.setColor(Color.RED);           
               // BufferedImage buffImg = new BufferedImage(imageWidth, imageHeight,BufferedImage.TYPE_INT_ARGB);
               // Graphics2D gbi = buffImg.createGraphics();
               // gbi.setComposite(ac);

            }
        }