I remember first seeing content aware image scaling at Adobe MAX in Barcelona I think it was. We were completely dumbfounded by what was surely magic happening on stage. When they showed removing objects we just lost it, jaws on the floor and all. That was a fun conference.
I'm the author of this library. The algorithm permits to remove an object from the image, only it needs somehow to be localized. After localization it can be applied to that area a higher energy map, which means that part will be avoided by the seam carver. I will implement a face detection algorithm to automatically exclude faces to get not altered by the carver.
Content-aware image resize library
71–80 of 84 posts
Re: Content-aware image resize library
#72Earlier quoted context omitted.
It's super fun but I can't think of many real-world uses. Maybe in subtle, element-wise stretching and reshaping as part of more complex editing? Squeezing images is a huge no-no in any graphic design, and while content-aware resizing is a neat trick to avoid the most glaring problems, it's still image squeezing. You'd rather just crop the image or choose a different one.
> Squeezing images is a huge no-no in any graphic design Surely this is true in journalism. I find it hard to believe it's true in ad work.
Re: Content-aware image resize library
#73It's similar to the effect that changing focal length on a camera has. eg. Wider angle lenses seem to squish far away objects and enlarge closer objects. However, this affects the entire image in a consistent way whereas changing focal length does not.
I wonder if this could be used to simulate focal length changes?
Re: Content-aware image resize library
#74Happy to see this here! Seam carving is one of those neat little algorithms that hit a sweet spot, being a sum of a few moderately complex algorithms, comes from a readable paper, and gives very satisfying result. I had a lot of fun implementing it in undergrad. One thing that I always wondered is how Photoshop managed to make it so fast that you can resize in real-time. If n is the width or height of the image, then…
Well, there is this paper called "Real-time content-aware image resizing" , maybe that describes the method you are curious about? > In this paper, we present a more efficient algorithm for seam based content-aware image resizing, which searches seams through establishing the matching relation between adjacent rows or columns. We give a linear algorithm to find the optimal matches within a weighted bipartite graph co…
Re: Content-aware image resize library
#75Happy to see this here! Seam carving is one of those neat little algorithms that hit a sweet spot, being a sum of a few moderately complex algorithms, comes from a readable paper, and gives very satisfying result. I had a lot of fun implementing it in undergrad. One thing that I always wondered is how Photoshop managed to make it so fast that you can resize in real-time. If n is the width or height of the image, then…
I also thought about augmenting this algorithm with the semantic information output of a neural network, but couldn't come up with a good way to generate training data for semantic segmentation which wouldn't distort objects. For example, if you consider an image of a roof, the roof pixels will all be semantically similar, but if you remove any of them just based on that, the regular structure will be distorted. Do y…
I know little about deep learning though, so I can't really comment on it.
For situations like the roof problem you describe, I think PatchMatch is more likely to work out well. The downside is that it's considerably harder to implement correctly than seam carving. http://gfx.cs.princeton.edu/pubs/Barnes_2009_PAR/patchmatch....
Re: Content-aware image resize library
#76Earlier 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....
Re: Content-aware image resize library
#77Just saying, but GIMP had this for years with Liquid Rescale plugin (I think before even Photoshop): http://liquidrescale.wikidot.com/
Re: Content-aware image resize library
#78Re: Content-aware image resize library
#79Just saying, but GIMP had this for years with Liquid Rescale plugin (I think before even Photoshop): http://liquidrescale.wikidot.com/