0

I had a color jpeg image and with the syntax below changed it to a grayscale png

from PIL import Image
img = Image.open('../house.jpeg').convert('L')
img.save('house_gs.png')

But it is 8-bit, how can I make it 4-bit so that each pixel of it becomes 4-bit?

Thank you.

martineau
  • 119,623
  • 25
  • 170
  • 301
  • PD: https://stackoverflow.com/questions/29699263/save-grayscale-image-as-4-bit-png-with-python – splash58 Nov 19 '21 at 18:36
  • Thanks, I'd seen that. I was hoping for a better approach, Is there any other way? – patrick_star Nov 19 '21 at 18:41
  • Does this answer your question? [Save grayscale image as 4 bit png with python](https://stackoverflow.com/questions/29699263/save-grayscale-image-as-4-bit-png-with-python) – BNazaruk Nov 20 '21 at 07:39

0 Answers0