I can't help but feel saddened that we learned how to code using View Source (indeed, it's a big factor in the web's success) and now we're trying to prevent others doing the same.<p>Also, this seems like a surprisingly naive generalisation to me: "... a first measurement for preventing evil business guys from stealing your code – developers who can figure the code out are (mostly) kind enough not to steal it."
>My JS code is an array of characters, a character has an ASCII code which lies in the range from 0 to 255<p>Your JS code may happen to be ASCII only, but in the context of ECMAScript, a character is actually a Unicode code unit.
Bonus points for not just creating an image, but hiding the code steganographically in an existing image (ie only using the LSB of each pixel to hide code)!
Here is an interesting application of this idea <a href="http://www.p01.org/releases/MATRAKA/matraka.png.html" rel="nofollow">http://www.p01.org/releases/MATRAKA/matraka.png.html</a>
If you are willing to use HTML5 'magic', could you not stream the JS down via a web socket and then execute it? That would prevent most of the conventional HTTP intercepts from having access to the code.
If someone is clever enough to hide their JavaScript like this, then they hopefully know that it isn't foolproof. In other words, don't rely on obfuscating your code for anything related to security (as an example).
This is the exact same process used by <a href="http://hid.im" rel="nofollow">http://hid.im</a> to encode a torrent file into a PNG (not for obfuscation, mind you).