News for hackers. Stuff that matters.
Re:Content-aware image resize library by ttoinou on Tuesday January 30, 2018 @07:21PM (#16270315)
Could we use any direction for pixel removal, rather than only vertical or horizontal ?
Re:Content-aware image resize library by bitL on Tuesday January 30, 2018 @09:50PM (#16270943)
You either shrink picture horizontally by one pixel or vertically by one pixel; seams must be 8-connected and always advance by 1 pixel in the opposite direction to the one being removed. It's a heuristics and by making it that way you can guarantee exactness of 1px removal.

These days it's a popular algorithm to be implemented as a midterm project in computational photography courses at top schools.

Re:Content-aware image resize library by vanderZwan on Tuesday January 30, 2018 @08:09PM (#16270531)
Well, think about what it would mean to remove a seam diagonally: the edges of the picture would no longer line up. The only way to avoid this is to always remove a seam along one of the axes at a time.
Re:Content-aware image resize library by jontro on Tuesday January 30, 2018 @08:10PM (#16270534)
Just run the algorithm twice?
Re:Content-aware image resize library by ianjsikes on Wednesday January 31, 2018 @12:59AM (#16271807)
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.