Live data from Hacker News

Content-aware image resizing in JavaScript

trekhleb.dev

31–40 of 68 posts

Re: Content-aware image resizing in JavaScript

#32
Totally unrelated to this great project, but I'm curious: do people really use content-aware resizing feature in practice?

I use Photoshop frequently, and I use content-aware removal A LOT (super handy). But it never occured to me, not even once, that I need to use the content-aware resizing despite it's there for years. If I really need to change the ratio of an image/photo I usually just crop.

Re: Content-aware image resizing in JavaScript

#33

Totally unrelated to this great project, but I'm curious: do people really use content-aware resizing feature in practice? I use Photoshop frequently, and I use content-aware removal A LOT (super handy). But it never occured to me, not even once, that I need to use the content-aware resizing despite it's there for years. If I really need to change the ratio of an image/photo I usually just crop.

Yes, I use it daily. Here is my project:

https://github.com/jftuga/photo_id_resizer

I am using this content aware image resizing library, which is used for: "Face detection to avoid face deformation."

https://github.com/esimov/caire

Re: Content-aware image resizing in JavaScript

#34
post #4

I wish there were more of such interesting and educational articles with great examples and explanations.

Yaz, Right??? One of the biggest complaints I have about HN is that it promotes really crappy "Look at me! I just learned a thing and wrote a 300 word blog doing a crappy job explaining it because I don't really get it but want to pad my CV..." This article is exceptional. Thank you OP.

> promotes really crappy "Look at me! I just learned a thing and wrote a 300 word blog doing a crappy job explaining it because I don't really get it but want to pad my CV..."

This is a broad brush, are you sure the intent is always resume padding? Some folks (like me) write poorly but I find writing tests what I know (and shows me what I don’t). I share anyway so I can be corrected and learn more, and so others might benefit if they have a similar problem. Your comment felt like shaming.

> This article is exceptional. Thank you OP.

100% agree, OP’s writing and content are examplary!

Re: Content-aware image resizing in JavaScript

#37
Simple solutions are great and I find seam carving elegant, but maybe that's an application where machine learning can shine?

As globally the task is defined as displacing pixels while minimizing a perceptual loss, it should be reasonably easy to express in a differentiable way. The benefits I see are higher quality semantics preservation, and potentially faster inference (one pass only).

The recent development of transformer models might provide just the tool to tackle variable sizes efficiently, maybe I should give it a go

Edit: if you're interested too and want to play on it together, shoot me a message :)

Re: Content-aware image resizing in JavaScript

#39
One of the good explanation of seam carving, but there are other facts as well.

1. It was first developed by Shai Avidan at MERL.

2. Then introduced in paper by Vidya Setlur, Saeko Takage, Ramesh Raskar, Michael Gleicher and Bruce Gooch in 2005 which won 10-year impact award in 2015.

3. Adobe Systems acquired a non-exclusive license to seam carving technology from MERL and implemented in Photoshop CS4.

Post reply on HN