4 ms·
Show HN: Palette Manipulator
PalTool is the ultimate swiss-army knife for converting palettes and reducing image sizes even in animations. Also smoothly converts between APNG, animated WebP and GIF.
Available as a dependecy-free CLI tool for Windows, Linux and as a web-service.
- gwbas1c 2mo agoWhat do you mean by "converting palettes"? Perhaps give some examples, with some before and after images.
- skrellm 2mo agoI mean all palette related conversions. See the README in https://gitlab.com/bztsrc/paltool https://gitlab.com/bztsrc/paltool For example, you can say, take a true-color animated WebP, quantize it to 64 colors max, but make sure the first 16 colors is the same as the default VGA palette, then save the result as an animated GIF. There's no point in example images, because the power of this tool is, you have full control on specifying how the conversion should be done. Just quantize to 256 individual colors? Sure. Convert to web-safe palette? Got you covered. Limit the colors to 8 for each 4 x 4 pixel blocks? Smooth sailing. Full disclosure: it generates much better results than Imagemagick "png8:", and it handles animated PNGs too.
- gwbas1c 2mo agoTLDR to your response to me. You should update the page to say that. I'm not going to jump through all those hoops to understand what a link on Hacker News is about.
- skrellm 2mo ago> You should update the page to say that. Definitely not. That page is the web service. And if you meant the HN post, that's no place for long explanations either, imho. The info you seek is in the README of the repo, where it belongs.
- gus_massa 2mo agoThe readme is nice. My suggestion is to write a blog post that includes the two examples in the readme and the example you posted in your comment, and perhaps one or two more (let's say 5 or 6 in total). And post the blog article. I feel if it includes a few use cases and images, it would get more traction.
- skrellm 2mo ago> My suggestion is to write a blog post Thank you for your kind advice. But the thing is, I'm not a blogger guy, I've never ever written any blog in my life. If you take a look at my repos, you'll see my focus is on writing code. Also I honestly don't know what to write. I've always though that speeding up page load by shrinking images into indexed images is a common knowledge (smaller page = faster page), never occurred to me this needs explaining. I mean, there are already lots of tools for that (tinypng dot com, ImageMagick, pngquant, etc.), it's just neither can handle APNGs, much less animated WebP, so here's paltool to save the day. As for the algorithms, all I've used (weighted color distance and median cut) has a loooong literature, explaining these much better than I could. I did not invent any of it, these are standard image processing algorithms, although I've used some tricks for better performance and some heuristics to increase output quality.
- gus_massa 2mo agoI was thinking about something simple, like a list of 10 examples with minimal text in between. If you meet with a technical friend to drink a beer, and s/he ask what your project can do, which are the 10 coolest examples that you can show? --- The readme has a few eamples. I'd like a version that shows the explicit command to make the transformation. For example "-D" means decolorize, but I'm not sure how to trigger the recolorize method. Is it "+D"? "-R"? After looking for a while, I think no argument means recolorize but I'm still not sure. Also, they show a strange pallete. I'd prefer a version that shows 1) The original image 2) The exact pallete (or at least a gif/png that shows the exact squares with the colors of the pallete. For example if the pallete has 8 colors, show a 32x4 image with 8 squares 4x4.) 3) The command line 4) The final image --- Perhaps a few examples that show the dithering vs direct quantization would be nice. --- Can your program find the optimal pallete? A long time ago I had to transform a color 256^3 image to a 256 colors image. IIRC I used gimp and paint and perhaps a few more programs. But the palette choice was bad and caused too many quirks. I don't remember how I fixed it. --- A few years ago, my wife wanted a few gif or animals with different colors. I used gimp to find the correct entry in the pallete and then I changed the value of that entry in the pallete directly in the files.