diff options
Diffstat (limited to 'pdf-as-common/src/main/java/at')
-rw-r--r-- | pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java index 5dd0f636..b426e1ce 100644 --- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java +++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/ImageUtils.java @@ -23,11 +23,9 @@ ******************************************************************************/ package at.gv.egiz.pdfas.common.utils; -import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; @@ -53,7 +51,7 @@ public class ImageUtils { .getLogger(ImageUtils.class); public static BufferedImage removeAlphaChannel(BufferedImage src) { - if (src.getColorModel().hasAlpha()) + /*if (src.getColorModel().hasAlpha()) { // extract the alpha information // WritableRaster alphaRaster = src. @@ -69,7 +67,17 @@ public class ImageUtils { g.dispose(); return image; } - return src; + return src;*/ + + BufferedImage rgbImage = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_3BYTE_BGR); + for (int x = 0; x < src.getWidth(); ++x) + { + for (int y = 0; y < src.getHeight(); ++y) + { + rgbImage.setRGB(x, y, src.getRGB(x, y) & 0xFFFFFF); + } + } + return rgbImage; } public static BufferedImage convertRGBAToIndexed(BufferedImage src) { |