Skip to content

Commit e40ddc4

Browse files
committed
fixed palette generation mistake
1 parent 9fce4c8 commit e40ddc4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

phixelgator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ def phixelate(img, palette, blockSize):
5353

5454
def generatePalette(img):
5555
"Generate a palette json file from an image. Image should NOT have an alpha value!"
56-
rgb = img.load()
57-
width,height = img.size
58-
return json.dumps(map(lambda (_,(r,g,b)): [r,g,b], img.getcolors(width*height)))
56+
return json.dumps(map(lambda (_,(r,g,b)): [r,g,b], img.getcolors(img.size[0]*img.size[1])))
5957

6058
def exitScript(args, code):
6159
args.infile.close()

0 commit comments

Comments
 (0)