Skip to content

Commit

Permalink
Use nearest interpolation to retain sharp pixels
Browse files Browse the repository at this point in the history
The default for Pillow's resize function must have changed at some point
in the last 7 years.
  • Loading branch information
xordspar0 committed Jan 8, 2021
1 parent 3cce03c commit ea2c135
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paper-skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@

# first the normal sections
for i in range(12):
printable.paste(skin.crop(skinCoords[i]).resize(newSizes[i]), printCoords[i])
printable.paste(skin.crop(skinCoords[i]).resize(newSizes[i], Image.NEAREST), printCoords[i])

# then the mirrored sections
for i in range(12, 18):
printable.paste(skin.crop(skinCoords[i-6]).resize(newSizes[i-6]).transpose(Image.FLIP_LEFT_RIGHT), printCoords[i])
printable.paste(skin.crop(skinCoords[i-6]).resize(newSizes[i-6], Image.NEAREST).transpose(Image.FLIP_LEFT_RIGHT), printCoords[i])

#
# Save the image
Expand Down

0 comments on commit ea2c135

Please sign in to comment.