Skip to content

Commit 98b7300

Browse files
committed
Correct PDF palette size when saving
1 parent da0b826 commit 98b7300

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)