
I know this would be very computationally expensive, but in some cases, it would be nice to be able to incrementally scale an image by one (or more, making it configurable would be great) seam at a time. That is, it would compute the best seam for removal (or inflation), adjust the image, and then recompute the best seam again, over and over until the desired number of pixels have been removed (or added).
This feature would especially make a difference when expanding an image. Currently the recommendation for large expansions that have a preserved area is to manually perform incremental rescales. Having this solution available would greatly simplify such operations.
A future direction this could go in is for feature removal. The user would no longer have to do anything except to determine which feature to remove. Using an incremental method, the idea would be to first calculate both the horizontal and vertical seams that would be removed, then to compare the "cost" of removing the horizontal seam to that of the vertical seam (this might need to be scaled based on aspect ratio, testing would have to be done. Also I'm definitely glossing over some details, but I hope my intention is clear). Whichever seam has a lower "cost" would be the one removed, and the next iteration would repeat this process until the discard area is removed completely. (Of course, for efficiency reasons, it should again be possible to remove more than one seam per iteration, where the given number of seams would determine the number of either horizontal or vertical seams to remove — not a combination of both.) Since the discard area has a high negative value, each iteration would remove a maximal number of discard pixels, so I would expect the entire process to converge quickly.
In any case, I don't expect the initial request to require much new development since it's mainly the same functionality in a loop. The "future direction" also doesn't seem like much of a change, since I presume that the only new code would be that which compares a given horizontal seam(s) to a given vertical seam(s) and determines which is better to remove. The biggest changes would likely be in the interface code.
I think this is worthwhile as long as it does not add too much code complexity; I would expect it to result in higher-quality images while also lightening the workload on the user (manually iterating for large expansions, taking time to determine the number and orientation of pixels to remove while discarding parts of an image, etc.).
I'm interested to hear what you think: bmintern A+ gmail D0+ com