Skip to content

Commit 6ede069

Browse files
fixup
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
1 parent 0b2fa3f commit 6ede069

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,8 +1784,7 @@ def _writeImg(self, data, id, smask=None):
17841784
data[:, :, 2])
17851785
indices = np.argsort(palette24).astype(np.uint8)
17861786
rgb8 = indices[np.searchsorted(palette24, rgb24, sorter=indices)]
1787-
img = Image.fromarray(rgb8)
1788-
img.convert("P")
1787+
img = Image.fromarray(rgb8).convert("P")
17891788
img.putpalette(palette)
17901789
png_data, bit_depth, palette = self._writePng(img)
17911790
if bit_depth is None or palette is None:

0 commit comments

Comments
 (0)