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 →

Join the Conversation


    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

Leave a Reply to Bart Cancel reply

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.