Live data from Hacker News

Content-aware image resize library

github.com

31–40 of 84 posts

Re: Content-aware image resize library

#31
post #7

Earlier quoted context omitted.

I wrote a version of this in javascript with a live demo you can play with at https://alexander.soto.io/seam-carving

Your JavaScript version is very easy to use, and I'm so glad I can upload my own images instead of just using examples! The algorithm itself looks like it needs face (and body) detection to be really useful, though. Example: My girlfriend and I on holiday in Australia. Original: http://peterburk.free.fr/seamCarving/lighthouse.jpg Shrunk: http://peterburk.free.fr/seamCarving/lighthouse_seamCarving....

In all fairness, the read me says “Todo: face detection”

Re: Content-aware image resize library

#33
post #7

Earlier quoted context omitted.

I wrote a version of this in javascript with a live demo you can play with at https://alexander.soto.io/seam-carving

Your JavaScript version is very easy to use, and I'm so glad I can upload my own images instead of just using examples! The algorithm itself looks like it needs face (and body) detection to be really useful, though. Example: My girlfriend and I on holiday in Australia. Original: http://peterburk.free.fr/seamCarving/lighthouse.jpg Shrunk: http://peterburk.free.fr/seamCarving/lighthouse_seamCarving....

Am I the only one getting a laugh out of this? I also tried it on myself and the result was funny.

Re: Content-aware image resize library

#34

I wrote a GUI for another seam carving library back in 2009[1], and it looks like although in archive mode, you can still access the source as well as the windows / mac binaries. Just tested it and it still works! Not as fancy as photoshop I'm sure, but does have the ability to paint a mask of regions to keep / remove to aid the algorithm and get the desired result. Multi-threaded too! [1] https://code.google.com/arc…

That's cool! I tried it, and the app is really nice to use, but the picture still came out looking weird. See my other comment below.

Re: Content-aware image resize library

#35
post #31

Earlier quoted context omitted.

Your JavaScript version is very easy to use, and I'm so glad I can upload my own images instead of just using examples! The algorithm itself looks like it needs face (and body) detection to be really useful, though. Example: My girlfriend and I on holiday in Australia. Original: http://peterburk.free.fr/seamCarving/lighthouse.jpg Shrunk: http://peterburk.free.fr/seamCarving/lighthouse_seamCarving....

In all fairness, the read me says “Todo: face detection”

That's true, and I agree with the author!

It will be more complicated than it seems, though, because I just tried the GUI version from gabeiscoding above, and got the following result:

http://peterburk.free.fr/seamCarving/lighthouse_seamCarvingG...

Re: Content-aware image resize library

#37
post #12
post #6

Could we use any direction for pixel removal, rather than only vertical or horizontal ?

Just run the algorithm twice?

Better yet, scale the image proportionally down to the largest of the two target sides, then run the algorithm once in the direction that needs to shrink.

Re: Content-aware image resize library

#39
post #7

Earlier quoted context omitted.

I wrote a version of this in javascript with a live demo you can play with at https://alexander.soto.io/seam-carving

Your JavaScript version is very easy to use, and I'm so glad I can upload my own images instead of just using examples! The algorithm itself looks like it needs face (and body) detection to be really useful, though. Example: My girlfriend and I on holiday in Australia. Original: http://peterburk.free.fr/seamCarving/lighthouse.jpg Shrunk: http://peterburk.free.fr/seamCarving/lighthouse_seamCarving....

With a little change to the algorithm, you can mark areas as "must not change" and "must change", basically manually marking areas as "high energy" and "low energy".
Post reply on HN