Last active
February 8, 2019 08:40
-
-
Save ryosms/01fb0a1b610e217f4cb423112062a185 to your computer and use it in GitHub Desktop.
Create 'CONGRATULATIONS' image from [pixela](https://pixe.la) using [pixela2img](https://github.com/ryosms/pixela2img).
This file contains hidden or 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
from pixela2img import Pixela2Img | |
from PIL import Image | |
converter = Pixela2Img() | |
congratul = converter.convert('ryosms', 'congratulations', date='20180210') | |
ations = converter.convert('ryosms', 'congratulations', date='20190216') | |
width = congratul.width + ations.width + 1 | |
height = congratul.height | |
congratulations = Image.new('RGBA', (width, height), (255, 255, 255, 0)) | |
pixel_size = 12 # include white space | |
crop_start = pixel_size * 4 + 1 | |
crop_end = pixel_size * 19 | |
congratulations.crop((crop_start, 0, width - crop_end, height)).save('congratulations.png') | |
# (left, top, right, bottom) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment