我正在尝试创建一个分辨率为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='white') as img:
img.resolution = 300
img.units = 'pixelsperinch'
img.save(filename='output.jpg')
这对Wand来说是一种奇怪的行为,因为构造函数中的参数是为图像解码器准备的。如果您想影响图像编码器;然后在图像对象的实例上设置属性。