Skip to content

Instantly share code, notes, and snippets.

@showyou
Created February 20, 2010 01:50
Show Gist options
  • Select an option

  • Save showyou/309434 to your computer and use it in GitHub Desktop.

Select an option

Save showyou/309434 to your computer and use it in GitHub Desktop.
import sys,Image
#needs pil
img = Image.open(sys.argv[1])
y, cr, cb = img.convert("YCbCr").split()
for px in range(0, img.size[0]):
for py in range(0, img.size[1]):
#rgb = img.getpixel((px,py))
yy = y.getpixel((px,py))
cr.putpixel((px,py), 110)
cb.putpixel((px,py), 159)
# process
#print ""
img = Image.merge("YCbCr", (y, cr, cb)).convert("RGB")
img.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment