Skip to content

Instantly share code, notes, and snippets.

@H4kor
Created March 23, 2015 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save H4kor/692828631db4d4797f80 to your computer and use it in GitHub Desktop.
Save H4kor/692828631db4d4797f80 to your computer and use it in GitHub Desktop.
A script to create a gradient list out of an image.
#
# author: Niko Abeler (H4kor)
# website: libove.org
# licence: beer-licence
#
import sys
import Image
if len(sys.argv) != 2:
print ""
print "Usage: python " + str(sys.argv[0]) + " [image]"
print "[image] = relative path to an image"
print "Hint: The image has to be at least 256 pixels wide."
print " Only the first 256 pixels will be used to create a gradient"
print ""
else:
img = Image.open(sys.argv[1])
l = []
for i in range(256):
l.append(img.getpixel((i,0)))
print l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment