Hacker News new | comments | ask | show | jobs | submit login

Really awesome, and the test cases look just as good as I could do.

I would warn web designers to not blindly apply this to everything though. It scans all the pixels of an image, which can take up to 100ms each, especially on mobile devices. A good use case would be a file upload box with a suggestion to crop the image upon upload.

It can be used as a node.js module on the server-side which I suspect would be the better place to run this kind of thing.

I'm not so sure you'd want to throw away all of that processing power on the client though. Running some performance testing on different types of devices and figuring out which ones can handle it fine to good enough (especially if you can do it in the background with a web worker) while sending really horribly performing devices right to the backend.

Indeed - I'm working on integrating this into the static site generator I use, so it's only run offline.

Good suggestion, though this could be true for both server-side processing and local processing. If you want the whole image uploaded, anyways - start that, and then run the crop in parallel, and just transmit the crop box once both are done, with minimal additional impact to interaction flow.

The tests highlight the fact that face detection might be an important parameter to add to the overall weight. Test photos where people had noisy shirts ended up getting cropped badly.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact