Hacker News new | ask | show | jobs
by DonnyV 51 days ago
I can't believe this doesn't mention Image Seam Carving. Surprise this was never built into browsers.

https://trekhleb.dev/js-image-carver/

3 comments

I think this is far too risky.

This doesn't help you if you want to save bandwidth, it worsens it.

It doesn't help you if you custom-crop images depending on the viewport size, because if you go that far to art direct, then you're not going to like the result of automated and unsupervised seam carving.

Just publish 3 sizes, maybe crop the smallest one if the focus area is too small. Done.

Building something like this into a browser would be a bad idea, as it's incredibly resource-intensive.
I'd seen the technique, but never visualized like that. Very cool.