Giter VIP home page Giter VIP logo

Comments (9)

Dynom avatar Dynom commented on May 18, 2024 2

@artyom https://github.com/artyom/smartcrop created a fork without OpenCV dependency!

from imaginary.

h2non avatar h2non commented on May 18, 2024 1

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

from imaginary.

h2non avatar h2non commented on May 18, 2024

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.

from imaginary.

Dynom avatar Dynom commented on May 18, 2024

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?

from imaginary.

Dynom avatar Dynom commented on May 18, 2024

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 ?

from imaginary.

h2non avatar h2non commented on May 18, 2024

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:

  • Port the smartcrop from OpenCV to libvips. Implies considerable non-trivial work.
  • Provide a programatic way, such a middleware/plugin layer, to easily extend behavior related to image processing, adding pre/post processors, extending the standard process pipeline currently done in bimg.

from imaginary.

Dynom avatar Dynom commented on May 18, 2024

So either option requires quite a bit of non-trivial work. What is the strongest argument against linking OpenCV?

from imaginary.

Dynom avatar Dynom commented on May 18, 2024

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:

from imaginary.

Dynom avatar Dynom commented on May 18, 2024

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.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.