JPEGBot is a Twitter bot I wrote that posts weird looking images to Twitter. It does this by searching Google Images for a semi-random word, downloading a random image from the results, and finally saving it as a JPEG 100 times, reducing the quality by one each time. The final result is the one that gets uploaded.
Below you can see four images posted by the bot at some point and their transition from the original image found via Google and the final one. Scroll to the right to see each one. Note that these have been resized and saved again to reduce bandwidth.
About JPEG Bot
I got the idea after talking with someone about how JPEG files seem inexplicably worse at compressing the color red compared other colors. During our discussion they asked why that was, and at the time I actually didn't know.
JPEG is actually a lossy compression algorithm, not a file format. It sacrifices image quality for file size, reducing the amount of image data in order to save space. The algorithm takes advantage of how humans perceive color and brightness and ends up dropping sharp transitions in brightness and color, which our eyes are less sensitive to compared to more gradual changes. JPEG is great for continuous tone images (like photographs), but anything with solid, single-color areas in it will never work well as a JPEG.
The compression works the same for reds, blues and every other color, however it turns out the human eye is much better at seeing reds compared other visible colors. About 65% of our cone cells receive red light, so we notice changes in red fields more than those of other colors.
Since JPEG is a lossy file format, every time you re-save one you are actually losing some image data (the artifacts become part of the new image). This is taken to an extreme extent with JPEGBot, which saves an image 100 times, starting with the highest quality (100, of course) and reducing it for every subsequent save.
The final image ends up being really interesting looking and can vary wildly depending on the quality of the original image:
For selecting a search term I decided to use Darius Kazemi's Corpora project. The repository supplies, simply, "lists of things". I change which lists it pulls from every so often (whenever I think the results are getting boring) but currently it's pulling in from lists of minor planets, chemicals, room types, types of cannabis and the "computer sciences" list (which seems to mostly cause it to print technology stack logos). If you go back far enough in the bot's history you can see animals, locations, people doing their jobs and random household objects.
If you want to know any other stuff, feel free to say something to me on Twitter.