Hacker News new | past | comments | ask | show | jobs | submit login

Actually, this is completely doable, even backwards compatible, with javascript:

JPEG has support for arbitrary metadata, mostly used today to put EXIF data in the files. IIRC, there's no reason we couldn't store a base64'd or even binary raw PNG file in there.

Once we put it in, we need to be able to extract it. There are EXIF javascript libraries out there, so that shouldn't be too much of a problem, since it's the same idea. I'm unsure if a binary raw PNG file could be used to generate the alpha channel like in the original article, but at least using the base64-encoded bitstream should be possible since that's natively supported.

It's backwards compatible since it uses the same structure as EXIF uses, which just gets ignored by non-compatible image viewers. Something easier might be to store a URL to the alpha channel PNG image in the EXIF, and then use javascript to download that image and use it as the alpha channel.

If I wasn't getting ready for a 2 month trip, I'd spend an hour or two whipping this up. Feel free to take this info and whip something up yourself!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: