-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature optional JPEG alpha channel #553
base: master
Are you sure you want to change the base?
Conversation
Interesting. Why is this specific to JPEG? Can we have a mask option for all image types? |
I did it specific for JPEGs because i only needed it there. But i think it's a good idea to have the mask for all image types. |
I added the |
I have a use case where big PDF files should be generated with many big JPEG files. The JPEG files must not be changed so that the Exif and other meta data stays intact. I found out that this is possible with PDFKit.
I have the additional requirement that the JPEG files can have an alpha channel. I found that PDFKit supports that for PNG files but not for JPEG files. I also found out that it's not difficult to add this feature to PDFKit. I added an extra option
alpha
which can be used to add a grayscale JPEG mask. When the parameter is not used the current behavior is retained. Example usage:I would be glad if you think this feature is of general interest and accept it. If you don't find this feature helpful feel free to decline the pull request. Nevertheless i would be glad to get some feedback. E.g. i increased the PDF version to 1.4 because transparency was not possible in PDF 1.3 but i am not sure if this is without side effects.