It just occurred to me that this should have been posted on "users" not "dev", so I'm forwarding it here. Sorry for the confusion. Constantine
---------- Forwarded message --------- From: Constantine Dokolas <cdoko...@gmail.com> Date: Wed, Sep 22, 2021 at 7:02 PM Subject: Getting and setting image and mask separately (PDImageXObject) To: <d...@pdfbox.apache.org> I'm processing images in PDFs and I sometimes get images with a "Mask". I want to separately retrieve the image (being the base) and the "Mask" and also generate (from these) a new base-Mask pair. This is in order to preserve the original format of the (optimized) image resource and size/compression of the individual images (using the BufferedImage can affect the resource size significantly). Unfortunately, SampledImageReader is only package-visible and I can't use it. What are my options? There is also no PDImageXObject.setMask(...), but I guess I can directly set the "Mask" in the dictionary. Thanks in advance, Constantine -- There is a computer disease that anybody who works with computers knows about. It's a very serious disease and it interferes completely with the work. The trouble with computers is that you 'play' with them! - Richard P. Feynman