From 0a1003291ac2fb7d934840f0c28c50261e2ec560 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Wed, 28 Mar 2018 08:28:15 -0700 Subject: [PATCH] Double image size to improve pixel clarity on resize --- experiments/tweetBot/tweet.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/experiments/tweetBot/tweet.py b/experiments/tweetBot/tweet.py index 7b43391d..bf3a274e 100755 --- a/experiments/tweetBot/tweet.py +++ b/experiments/tweetBot/tweet.py @@ -222,6 +222,11 @@ def main(dry): # set bottom-right pixel to 254 alpha pixels[w - 1, h - 1] = pixels[w - 1, h - 1][:3] + (243,) + + # Resize to 2x so that pixels remain a bit more crisp when resized + w, h = (2 * w, 2 * h) + img = img.resize((w, h), 0) + img.save(screenshot_path) options = {"skinUrl": skin_url}