public void processImage() throws Exception {

        byte[] originalImageBytes = baseImageProvider.getImage();
        byte[] watermarkImageBytes = watermarkImageProvider.getImage();

        if (originalImageBytes == null) {
            throw new Exception("Original Image is not loaded");
        }
        if (watermarkImageBytes == null) {
            throw new Exception("WatermarkImage is not loaded");
        }

        BufferedImage original = ImageIO.read(new ByteArrayInputStream(originalImageBytes));
        BufferedImage watermark = ImageIO.read(new ByteArrayInputStream(watermarkImageBytes));

        if (original.getWidth() < watermark.getWidth()) {
            throw new Exception("Original width is smaller than watermark");
        }
        if (original.getHeight() < watermark.getHeight()) {
            throw new Exception("Original height is smaller than watermark");
        }

        BufferedImage combined = new BufferedImage(original.getWidth(), original.getHeight(), BufferedImage.TYPE_INT_ARGB);
        Graphics graphics = combined.getGraphics();
        graphics.drawImage(original, 0, 0, null);

        int offsetX = calculateOffset(original.getWidth(), watermark.getWidth(), horizontalAlignment);
        int offsetY = calculateOffset(original.getHeight(), watermark.getHeight(), verticalAlignment);

        graphics.drawImage(watermark, offsetX, offsetY, null);

        combinedImage = combined;

    }