3 ms·
Ah, I just realized that this simply prints text out in a gif... it doesn't encode text in the gif and then decode it in the browser into text that javascript c
by arscan 14y ago
Ah, I just realized that this simply prints text out in a gif... it doesn't encode text in the gif and then decode it in the browser into text that javascript could manipulate. Too bad. I wonder if that's possible...
- streptomycin 14y agoIt is possible, as you can now get the raw pixel data of an image by copying it to a canvas and using getImageData. <img src="test.gif" id="img"> <script type=text/javascript> var img = document.getElementById("img"); var canvas = document.createElement("canvas"); canvas.width = img.width; canvas.height = img.height; var ctx = canvas.getContext("2d"); ctx.drawImage(img, 0, 0); var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); </script> Then you can do whatever you want with the pixel data.
- xxbondsxx 14y agoEncoding data into images is certainly possible, albeit sometimes a PITA.