From 0dad4e12976720ef16de28cbd54086ef652ab2ec Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Mon, 8 Aug 2022 15:37:38 +0200 Subject: fix transparent pixel handling in AWT -> SWT image converter, cf. #109 --- .../src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java index 08adb0f2..b3687022 100644 --- a/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java +++ b/pdf-over-commons/src/main/java/at/asit/pdfover/commons/utils/ImageUtil.java @@ -246,6 +246,8 @@ public final class ImageUtil { raster.getPixel(x, y, pixelArray); int pixel = palette.getPixel(new RGB(pixelArray[0], pixelArray[1], pixelArray[2])); data.setPixel(x, y, pixel); + if (3 < pixelArray.length) + data.setAlpha(x, y, pixelArray[3]); } } return data; -- cgit v1.2.3