I have some images with 24 bit depth that I should convert them to 8 bit depth. So I can do it for one image but for multiple images I get this error :
a=img.convert("P", palette=Image.ADAPTIVE, colors=8)
AttributeError: 'list' object has no attribute 'convert'
I tried this code:
from PIL import Image
import os
os.chdir('D:\\background')
img=os.listdir()
a=img.convert("P", palette=Image.ADAPTIVE, colors=8)
a.save('D:\\test')
So if I want to convert multiple files with pillow how should I do it?
