16bit depth png, got error: Refusing to work with multiple >8bit channels. #170
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi
When I convert some pngs to PDF, I get the following error.
In the code, there states that PIL will lossily convert 16-bit images to 8-bit, so img2pdf refuses to work with those images.
If I'm happy with the lossily convertion, could you please suggest some steps to continue the conversion?
Env
MacOS 13.4
Python 3.11
img2pdf 0.4.4
You are right, the warning should include what to do if one is fine with lossy conversion. How about the following patch:
(Or theoretically one could add an option allowing img2pdf to continue lossily if explicitly requested by the user, but I know you want to keep img2pdf lossless-only, and probably you don't want to bloat it with too many new options, either.)
Yes, what @mara0004 said is correct. If somebody wants to do lossly conversion, then imagemagick already exists and can take care of this. No need for img2pdf if lossy is fine for you. There are plenty of other tools that will do the job just fine.
Thank you and the warning patch looks good. I will check the depth of the image first, if it's not 8 bit, use imagemagick to convert it first. Then use img2pdf to convert it to PDF.