Show HN: Triangul-Art – make pixel art but with triangles
21–30 of 39 posts
Re: Show HN: Triangul-Art – make pixel art but with triangles
#22Re: Show HN: Triangul-Art – make pixel art but with triangles
#23Earlier quoted context omitted.
Just serialize the state in the hashfragment of the URL ;)
Better find a good and efficient way to serialise it, otherwise it's gonna reach the URL length limitation. :-O But if you're up for it, please make a PR! :-D
A simple 256-bit hash is probably plenty but if I'm off by a few thousand orders of magnitude, just make it a 512-bit hash. :)
Re: Show HN: Triangul-Art – make pixel art but with triangles
#24Re: Show HN: Triangul-Art – make pixel art but with triangles
#25Earlier quoted context omitted.
Just serialize the state in the hashfragment of the URL ;)
Better find a good and efficient way to serialise it, otherwise it's gonna reach the URL length limitation. :-O But if you're up for it, please make a PR! :-D
Re: Show HN: Triangul-Art – make pixel art but with triangles
#26Earlier quoted context omitted.
Just serialize the state in the hashfragment of the URL ;)
Better find a good and efficient way to serialise it, otherwise it's gonna reach the URL length limitation. :-O But if you're up for it, please make a PR! :-D
If you want to pack tighter, a palettized serialization would work fine here. Since you don't have a gradient tool or anything else that can span colors, you have a bound on the amount of information being put into the image by the fact the human is only clicking so many times and can only put so much effort into it.
Basically, store each 24-bit color at the beginning with a tight mapping (4 bytes each with a base64), put an end-marker on the palette set, store the map size, then store the palette entry of each of the width x height triangles. If the user uses less than 256 colors, the default 20x30 size you bring up will end up as 4 times colors + 800 bytes, and that's before you do things like bitpacking ("I see the palette only has 8 colors in it so I only need three bits per cell") or any simple RLE you may be inclined to.
Re: Show HN: Triangul-Art – make pixel art but with triangles
#27Re: Show HN: Triangul-Art – make pixel art but with triangles
#28First time I somehow didn't notice the color picker, which is simple & effective. Having a couple preset colors already there might not hurt though?
Re: Show HN: Triangul-Art – make pixel art but with triangles
#29Re: Show HN: Triangul-Art – make pixel art but with triangles
#30Is that color picker a built-in?