Merge pull request #7555 from radarhere/pdf_palette

Correct PDF palette size when saving
This commit is contained in:
Andrew Murray 2023-12-04 21:54:01 +11:00 committed by GitHub
commit b431e2c140
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,7 @@ def _write_image(im, filename, existing_pdf, image_refs):
dict_obj["ColorSpace"] = [
PdfParser.PdfName("Indexed"),
PdfParser.PdfName("DeviceRGB"),
255,
len(palette) // 3 - 1,
PdfParser.PdfBinary(palette),
]
procset = "ImageI" # indexed color