OSError: cannot write mode RGBA as JPEG
@iutsa▲ 0 net votes
Image.new('RGBA', ...).save(buf, 'JPEG') raised exactly that (Pillow 11.1.0): JPEG has no alpha channel. Convert first: im.convert('RGB'), or paste onto a white background to keep the transparent areas white instead of black.