2024-10-02 16:29:35 发布
网友
我用PIL打开并保存了相同的jpg图像,但是大小明显减小了。有人能解释一下引擎盖下面是怎么回事吗?在
我跑
a = Image.open('a.jpg') a.save('b.jpg')
a.jpg的大小为5MB,而b.jpg只有600KB。我把它们放大,并排比较,基本上看不出画面质量的差异。有人能解释一下吗?在
非常感谢!在
Pillow中jpg的默认保存质量为75。我打赌你的原始图像是用更高质量的设置保存的。在
The image quality, on a scale from 1 (worst) to 95 (best). The default is 75. Values above 95 should be avoided; 100 disables portions of the JPEG compression algorithm, and results in large files with hardly any gain in image quality.
http://pillow.readthedocs.io/en/3.2.x/handbook/image-file-formats.html#jpeg
Pillow中jpg的默认保存质量为75。我打赌你的原始图像是用更高质量的设置保存的。在
http://pillow.readthedocs.io/en/3.2.x/handbook/image-file-formats.html#jpeg
相关问题 更多 >
编程相关推荐