Merge pull request #7317 from radarhere/pdf_alpha

Set SMaskInData to 1 for LA PDFs
This commit is contained in:
Andrew Murray 2023-08-04 23:54:20 +10:00 committed by GitHub
commit fc99a5871e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -162,8 +162,8 @@ def _save(im, fp, filename, save_all=False):
elif im.mode == "LA":
filter = "JPXDecode"
# params = f"<< /Predictor 15 /Columns {width-2} >>"
colorspace = PdfParser.PdfName("DeviceGray")
procset = "ImageB" # grayscale
dict_obj["SMaskInData"] = 1
elif im.mode == "P":
filter = "ASCIIHexDecode"
palette = im.getpalette()