[英]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.