网络编程
位置:首页>> 网络编程>> Python编程>> Python Pillow.Image 图像保存和参数选择方式

Python Pillow.Image 图像保存和参数选择方式

作者:Lv_Can  发布时间:2023-03-03 03:36:54 

标签:Python,Pillow.Image,图像保存

保存时代码如下:


figure_corp = figure.crop( (32*rate/2, 32*rate/2, 32-32*rate/2, 32-32*rate/2))
figure.save('save_picture/picture.jpg',quality=95,subsampling=0)
figure_corp.save('save_picture/picture_crop.jpg',quality=95,subsampling=0)

其中quality数值会影响图片的质量(1最差,95最好)

subsampling参数:子采样,通过实现色度信息的分辨率低于亮度信息来对图像进行编码的实践。 可能的子采样值是0,1和2,正常0可以满足图片大小增大的需求。

来源:https://blog.csdn.net/weixin_42074867/article/details/90439088

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com