TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Image Cropping and Scaling Algorithm using Graph Theory

10 pointsby axitkhuranaabout 13 years ago

2 comments

keenerdabout 13 years ago
Site does not render without JS enabled. At all. You get a flat white page. Enabling JS lets it render, but also scrolls crippling slowly. If I could downvote right now I would.<p>But it gets worse.<p>Nothing in here is about graph theory. It is a massive over complication. He is just trying to resize to a new aspect ratio by cropping the least amount. While dragging in calculus? This is really very simple and common. Imagemagick even has a dedicated option for it:<p><pre><code> -resize &#60;size&#62;^ -gravity center -extent &#60;size&#62; </code></pre> That caret does all the heavy lifting. (see <a href="http://www.imagemagick.org/Usage/resize/#fill" rel="nofollow">http://www.imagemagick.org/Usage/resize/#fill</a> for more)<p>To add insult to injury, he then uses Imagemagick to do the resize! The article is misleading, poorly written and hosted on a horrible platform to boot.
jameshartabout 13 years ago
Not, by any stretch, remotely, anything to do with graph theory. If you're mathematically inclined, you might call the techniques used 'linear algebra', but even the non-mathematically inclined will probably have encountered them in school as just plain 'algebra'. And most people could solve this problem without symbol manipulation by just drawing themselves a couple of pictures and doing basic arithmetic.