Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for seam carving #6

Open
melinath opened this issue Mar 6, 2012 · 5 comments
Open

Add support for seam carving #6

melinath opened this issue Mar 6, 2012 · 5 comments

Comments

@melinath
Copy link
Owner

melinath commented Mar 6, 2012

Although seam carving is ostensibly supported through https://github.com/sameeptandon/python-seam-carving/blob/master/CAIS.py, the code providing it is way out of date, and the implementation itself is two years old and extremely slow. Seam carving would be great to have, once we have things like out-of-band image adjustments, but it should be done right when that time comes.

@melinath
Copy link
Owner Author

I've added experimental seam carving support in the seamcarve branch. Times are given for my 1.7GHz Macbook Air, which is running a bunch of other programs at the time.

The current bottleneck is in recalculating the cost matrix; I am out of ways to make it faster. The implementation also doesn't take areas into account, which it should. I should add that the program is currently bound by the CPU on my computer. With a more powerful machine, it would presumably go faster. However, I still don't think this is a practical implementation for a website. Unless someone else can find a way to make this faster, I'm leaving it as is: an experimental branch.

Original (512x341)
castle_original

450x300 (~15 seconds, 103 seams)
450x300

200x200 (~45 seconds, 453 seams)
200x200

@harrislapiroff
Copy link
Contributor

Whoaaa.

@harrislapiroff
Copy link
Contributor

We could always implement it, warn heavily in the documentation, and encourage people to use preadjustments if they're using seam carving?

Although, I guess without a serious use case, our only real motivation to do that is that it's AWESOME.

@melinath
Copy link
Owner Author

Yeah... I think the main reason we wanted this was the awesomeness factor. ;-) We could offer it with preadjustments, but that wouldn't help the case where someone uploaded an image which was viewed immediately. We'd need some sort of "fast version" which could placehold while the slow version was computed.

@melinath
Copy link
Owner Author

Apparently Image Magick has a plugin for seam carving. And there's at least one python library for interfacing with Image Magick. So maybe that would be an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants