我是PIL的新手,对某些图像处理有疑问。我只是想使用PIL将图像调整为其他分辨率:
resized_hd = image.resize((hd_width, hd_height), Image.ANTIALIAS)
但是,调整大小后的图片看起来不如原始图片好/明亮。
原始(5184 * 3456)-> http://d31d9cjolqcwln.cloudfront.net/San+Francisco/sutro+baths.jpg调整大小(2048 * 1366)-> http://d31d9cjolqcwln.cloudfront.net/San+Francisco/HD -sutro + baths.jpg
有什么猜想吗?
Kuddo向Armin提出了建议。
Pil允许您使用以下代码将ICC配置文件附加到调整大小的图像:
icc_profile = im1.info.get('icc_profile')
im6 = im1.resize((hd_width, hd_height), Image.ANTIALIAS)
## this one will preserve the colours
im6.save("colorok-"+image,icc_profile=icc_profile)
## this one don't
im6.save("nop-"+image)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句