PNGStore – Embedding compressed CSS & JavaScript in PNGs

In the same series as the previously posted Suncalc 3D I’ve stumbled upon AirStrike, a JavaScript Flight Control clone that weighs less than 10kB (!).

What’s so clever about this app is that the source is encoded into a .png, a technique that’s been around for quite a while as it turns out (2008!).

Pretty decent results and even for packed (or otherwise minified) scripts we can shave off another 50% using this method. The PNG’s can even be further compressed using various optimizing tools.

Hacky. I like!

PNGStore – Embedding compressed CSS & JavaScript in PNGs →
Compression using Canvas and PNG-embedded data →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Join the Conversation

2 Comments

    1. It’s JavaScript, don’t see any reason to secure the code (it’s plaintext, ergo it can always be de-obfuscated, de-minified, etc.)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.