The reason we kept this package local is so that we can make changes without breaking the API. So for you the best would be to copy that file.

Alternatively copy the mask from the alpha layer of the BufferedImage. You mention you don't want to use BufferedImage but how else would you process this?

Tilman

Am 23.09.2021 um 12:04 schrieb Constantine Dokolas:
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



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to