an image bot that exploits png transparency quirks.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
default.png
imagemagicks.sh
pngbot.py
pngbot_keys.py

README.md

pngbot

pngbot is a bot designed to combine two png images in one so that it appears as the 1st image in preview and the 2nd in fullsize view. This is possible due to the fact that image viewers usually change the background color between white (or some shade of white) for thumbnail to black in fullsize view states. I've observed that it works on twitter, tumblr, and also on iPhones!
examples:

I first encountered this effect via twitter user @taki_bump, but as of 2018, the account seems to have been deleted or renamed?
ex:
Click to view alternate Image

Operation:

  • First it checks for new mentions and downloads the image attachments to the working directory as png0.png and png1.png.
  • Next it will call the shell script to do the imagemagick conversion and composite commands. If the mention provides only one image, it uses default.png as the 1st image.
  • Mentions are logged to a file called mentionlog.txt in the working directory.

APIs/ Prerequisites: