![](/img/trans.png)
[英]Merging two strings recursively in python without using built-in functions
[英]Python - inverting a bitmap image without using ImgOps 'invert' or other built-in functions
我想知道如何使用PIL在Python中反转图像,但我不能使用“反转”或“转换”或任何其他“简便”的方式进行转换。
任何帮助,将不胜感激。 谢谢 :)
pix = im.load()
print pix[x, y]
pix[x, y] = value
像这样反转RGB元组:
red, green, blue = pixel
red = 256 - red
green = 256 - green
blue = 256 - blue
pixel = red, green, blue
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.