Closed ciceroverneck closed 7 years ago
Thank you! I have also in mind introduce support for smart crop, mostly following this implementation.
At this time, you can perform the smart crop calculus using another solution, and then extract the image area using imaginary
.
I believe the technical term to be Seam Carving or Liquid Rescaling. Just mentioning it here in case people search the issues for it.
I think it would be a great feature to have! But I'm curious, what should happen when no "interesting" center is determined?
There is a Go version of smartcrop
that seems fairly trivial to add to Imaginary https://github.com/muesli/smartcrop
What is your roadmap on the "smart crop" endeavor @h2non ?
The unique bad part I see here is that it depends on OpenCV. I'm not too much open in adding another C dependency which mostly provides the same as libvips
.
Some intermediate solutions could be:
OpenCV
to libvips
. Implies considerable non-trivial work.bimg
. So either option requires quite a bit of non-trivial work. What is the strongest argument against linking OpenCV?
@Artyom https://github.com/artyom/smartcrop created a fork without OpenCV dependency!
As of libvips version 8.5.0, there is a "smart crop" feature available. It's based on Sharp's smartcrop, which I think is the same as linked earlier here in the Issue.
See also:
I've made a PR to implement bimg's smartcrop API. It's obviously not face-detection, but perhaps it's enough for your use-case @cicerocomp ?
From imaginary
v1.0.8+, there is first-class support for smart cropping relying on the built-in cropping algorithm in libvips
. There is no plans to support face detection in imaginary
.
For more details, see the documentation: https://github.com/h2non/imaginary#get--post-smartcrop
Link thumbor. Implement a Detection Algorithms (https://github.com/thumbor/thumbor/wiki/Detection-algorithms)