Je suis en train de télécharger une image qui a été convertie en niveaux de gris, comme ceci:image en niveaux de gris Uploading Python
blob_path = os.path.join(os.path.split(__file__)[0], 'static/img/blob-masks/1.png')
blob = Image.open(blob_path).convert('L')
buffer = StringIO()
blob.save(buffer)
upload_image(buffer.getvalue(),"foo.png")
Mais il semble juste de télécharger un carré noir.
Si je suis arrivé à la ligne de commande python et lancez:
col = Image.open("/static/img/blob-masks/5.png")
col.convert('L')
col.save("result_bw.png")
result_bw.png
est parfait. Qu'est-ce qui ne va pas?