PIL cannot write mode F to jpeg
Try convert the image to RGB: … new_p = Image.fromarray(fft_p) if new_p.mode != ‘RGB’: new_p = new_p.convert(‘RGB’) …
Try convert the image to RGB: … new_p = Image.fromarray(fft_p) if new_p.mode != ‘RGB’: new_p = new_p.convert(‘RGB’) …
As correctly answered above, using a “typical” JPEG encoder at quality 100 does not give you lossless compression. Lossless JPEG encoding exists, but it’s different in nature and seldom used. I’m just posting to say why quality 100 does not mean lossless. In JPEG compression information is mostly lost during the DCT coefficient quantization step … Read more