Live data from Hacker News

Content-aware image resizing in JavaScript

trekhleb.dev

41–50 of 68 posts

Re: Content-aware image resizing in JavaScript

#42
post #14

You can also apply this to each frame in a video for a rather interesting effect. My brother has a YouTube channel full of content-aware scaling videos: https://youtu.be/a8k3b-QNbhs

Really cool. Do you know what he’s using to do the scaling?

Re: Content-aware image resizing in JavaScript

#43
post #14

You can also apply this to each frame in a video for a rather interesting effect. My brother has a YouTube channel full of content-aware scaling videos: https://youtu.be/a8k3b-QNbhs

Oh that's horrifying/skin-crawling. I don't know what's wrong with me, but I can't stand to watch it. :)

Re: Content-aware image resizing in JavaScript

#44
post #14

You can also apply this to each frame in a video for a rather interesting effect. My brother has a YouTube channel full of content-aware scaling videos: https://youtu.be/a8k3b-QNbhs

Wow, that's incredibly interesting! My first reaction is how actor's faces look surprisingly like traditional caricatures that illustrators do -- e.g. shrinking foreheads and chins which are detail-light but keeping eyes and ears which are detail-heavy. But my second thought is that the extreme jumpiness in frames occurs because each frame is processed separately. But if you considered each seam not to be a "jagged l…

That's quite an insight!

Actually the authors of the seam carving paper went on to do just that [0]. From the abstract: "We present video retargeting using an improved seam carving operator. Instead of removing 1D seams from 2D images we remove 2D seam manifolds from 3D space-time volumes. To achieve this we replace the dynamic programming method of seam carving with graph cuts that are suitable for 3D volumes."

[0] https://faculty.idc.ac.il/arik/SCWeb/vidret/index.html

Re: Content-aware image resizing in JavaScript

#45
post #14

You can also apply this to each frame in a video for a rather interesting effect. My brother has a YouTube channel full of content-aware scaling videos: https://youtu.be/a8k3b-QNbhs

Very interesting, but it is hard to watch for me because of extreme shaking. Maybe some morphing would smooth the transitions.

Re: Content-aware image resizing in JavaScript

#47

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.

Now that I am aware it exists, I can use it for blog headers where I'd like to maintain the same ratio, this would be needed for images that have details around the edges I don't want to lose.

Re: Content-aware image resizing in JavaScript

#49
post #14

You can also apply this to each frame in a video for a rather interesting effect. My brother has a YouTube channel full of content-aware scaling videos: https://youtu.be/a8k3b-QNbhs

Really cool. Do you know what he’s using to do the scaling?

In the video comments he includes a link to a tutorial but essentially he is dumping all the frames and then running a script to content aware scale down the frames 50% and then merges it all back together.

Re: Content-aware image resizing in JavaScript

#50
post #14

You can also apply this to each frame in a video for a rather interesting effect. My brother has a YouTube channel full of content-aware scaling videos: https://youtu.be/a8k3b-QNbhs

Wow, that's incredibly interesting! My first reaction is how actor's faces look surprisingly like traditional caricatures that illustrators do -- e.g. shrinking foreheads and chins which are detail-light but keeping eyes and ears which are detail-heavy. But my second thought is that the extreme jumpiness in frames occurs because each frame is processed separately. But if you considered each seam not to be a "jagged l…

>You might need to build a bit more flexibility into it to allow for discontinuities generated from object movement and camera panning, but I wonder if anyone's tried to do something like that?

easier solution would probably be frame interpolation between the two seperate frames.

Post reply on HN