Hacker News new | ask | show | jobs
by Biqh1 1887 days ago
To what extent does this reduce image file size? Could I use this as an alternative to dithering for lazily loading large images on a website, for example?
2 comments

axe312ger/SQIP[1] does this effectively in low-quality image loading relying on the before-mentioned fogleman/primitive library. I think OP's project would be great to add as a new entry to the SQIP demo site [2].

In the thumbnail demo, the LQIP-custom approach (simple resize to low-res jpg thumbail+optimize jpg) approach preserves the more salient features better and has compression on-par-or-better than SQIP with lower processing times. So in my opinion the simple extreme resize+jpgoptim is preferable for thumbnails.

Thumbnails are only small part of LQIP story though and I can imagine RH12503/Triangula having much nicer results for larger images than fogleman/primitive. OP should consider writing an axe312ger/sqip plugin.

1. https://github.com/axe312ger/sqip

2. https://axe312ger.github.io/sqip/

That's an interesting idea! I suppose it could be used for compression, although my intentions were for this to be a generative art project.

I triangulated a 1988×1491 jpg using 10,000 points and managed to reduce the size to 20% of the original size, but the triangles could still obviously be seen.

You could probably make it into an SVG file to reduce the size even more.
Love this idea. A novel vectorization.
Adding my voice to this. It would be an amazing tool for web work -- the vectorized images look far better than the very small jpeg images used in lazy loading today.
Similar functionality is already implemented in Boxy SVG editor [1]. There is also another more powerful "Primitivize" generator which has more options, e.g. you can choose whether the vectorized image should consist from triangles or rectangles.

[1] https://i.imgur.com/I8Fq1bM.gif

And could inline, so that the preview image is loaded with the page itself.
It sure looks better aestethically esimov/triangle or fogleman/primitive! Goal achieved I would say.

It still would be cool to see this compared to those in Low Quality Image Placeholder implementations and find out if the extra work on nicer aethetics is preserved when the blur applied.

Blurring is a good idea! It could work with placeholder images, but it'll probably be better with smaller ones (eg. profile pictures).