Created
March 23, 2015 22:37
-
-
Save H4kor/692828631db4d4797f80 to your computer and use it in GitHub Desktop.
A script to create a gradient list out of an image.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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