mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Set SMaskInData to 1 for PDFs with alpha
This commit is contained in:
parent
6d3630d406
commit
022e650d18
|
@ -128,6 +128,7 @@ def _save(im, fp, filename, save_all=False):
|
|||
bits = 8
|
||||
params = None
|
||||
decode = None
|
||||
smaskindata = 0
|
||||
|
||||
#
|
||||
# Get image characteristics
|
||||
|
@ -177,6 +178,7 @@ def _save(im, fp, filename, save_all=False):
|
|||
filter = "JPXDecode"
|
||||
colorspace = PdfParser.PdfName("DeviceRGB")
|
||||
procset = "ImageC" # color images
|
||||
smaskindata = 1
|
||||
elif im.mode == "CMYK":
|
||||
filter = "DCTDecode"
|
||||
colorspace = PdfParser.PdfName("DeviceCMYK")
|
||||
|
@ -232,6 +234,7 @@ def _save(im, fp, filename, save_all=False):
|
|||
Decode=decode,
|
||||
DecodeParms=params,
|
||||
ColorSpace=colorspace,
|
||||
SMaskInData=smaskindata,
|
||||
)
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue
Block a user