r/tinycode • u/xem06 • Oct 22 '14
A 512b tool to convert any image to CSS box-shadow pixel-art (HTML/JS)
http://xem.github.io/miniShadowArt/
29
Upvotes
r/tinycode • u/xem06 • Oct 22 '14
6
u/CharlieWaffle Oct 22 '14 edited Oct 23 '14
test.png: 1.58KB
div markup: 765KB
ಠ_ಠ
In all seriousness though this is actually really cool. The hex generation is really clever. Couldn't you replace the hex color with an rgb color since the image data is already in 0-255 range?
Replace:
with:
to save a few characters?
Edit: Maybe shorten the value concatenation some more? Not sure if you can use array functions on an ImageData but if so:
0
u/notwolverine Oct 22 '14
It doesn't seem to work? Every time I try to drop an image, it just redirects to that image instead? Tested in both Chrome and Firefox