Python 魔杖无法设置正确的图像分辨率
我正在尝试创建分辨率为300dpi的新jpeg图像Python 魔杖无法设置正确的图像分辨率,python,wand,Python,Wand,我正在尝试创建分辨率为300dpi的新jpeg图像 with Image(width=300, height=300, background=Color('white'), units = 'pixelsperinch', resolution=(300,300)) as ImgBackground: ImgBackground.save(filename='ImgOut.jpg') 但是这个文件在photoshop中的分辨率仍然是72dpi/英寸 我不知道为什么。有什么想法吗?试试
with Image(width=300, height=300, background=Color('white'), units = 'pixelsperinch',
resolution=(300,300)) as ImgBackground:
ImgBackground.save(filename='ImgOut.jpg')
但是这个文件在photoshop中的分辨率仍然是72dpi/英寸
我不知道为什么。有什么想法吗?试试下面的方法
图像(宽=300,高=300,背景为白色)作为img:
img.分辨率=300
img.units='pixelsperinch'
save(filename='output.jpg')
这对于Wand来说是一个奇怪的行为,因为构造函数中的参数是用于图像解码器的。如果您想影响图像编码器;然后在图像对象的实例上设置属性