mzucker / noteshrink

Convert scans of handwritten notes to beautiful, compact PDFs
https://mzucker.github.io/2016/09/20/noteshrink.html
MIT License
4.81k stars 351 forks source link

pillow 10.4 error PIL\Image.py", line 1087, in convert im = self.im.convert(mode, dither) ValueError: conversion not supported #49

Open nissansz opened 7 months ago

nissansz commented 7 months ago

pillow 10.4 error PIL\Image.py", line 1087, in convert im = self.im.convert(mode, dither) ValueError: conversion not supported

nissansz commented 7 months ago
output_img = Image.fromarray(labels, 'P')
output_img.putpalette(palette.flatten())
print(output_filename)
output_img.save(r"F:/"+output_filename, dpi=dpi)

Added a root folder, and it is fine to save a result, the color changes, image size reduced