Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created September 29, 2013 13:15
Show Gist options
  • Save KelSolaar/6752432 to your computer and use it in GitHub Desktop.
Save KelSolaar/6752432 to your computer and use it in GitHub Desktop.
PIL - Simple Linear Ramp
from PIL import Image
width, height = 256, 32
image = Image.new("RGB", (width, height))
pixels = image.load()
for i in range(image.size[0]):
for j in range(image.size[1]):
pixels[i,j] = (i, i, i)
image.save("Linear_Ramp.png", "PNG")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment