Skip to content

Commit b431e2c

Browse files
authored
Merge pull request #7555 from radarhere/pdf_palette
Correct PDF palette size when saving
2 parents 80d0ed4 + 98b7300 commit b431e2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PIL/PdfImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def _write_image(im, filename, existing_pdf, image_refs):
9696
dict_obj["ColorSpace"] = [
9797
PdfParser.PdfName("Indexed"),
9898
PdfParser.PdfName("DeviceRGB"),
99-
255,
99+
len(palette) // 3 - 1,
100100
PdfParser.PdfBinary(palette),
101101
]
102102
procset = "ImageI" # indexed color

0 commit comments

Comments
 (0)