GithubHelp home page GithubHelp logo

Smart crop support about bimg HOT 4 CLOSED

h2non avatar h2non commented on May 20, 2024
Smart crop support

from bimg.

Comments (4)

jcupitt avatar jcupitt commented on May 20, 2024 3

Alternative smart crop in libvips:

https://gist.github.com/jcupitt/c2792a9b22e4e2544147

It's a slightly different algorithm. Rather than attempting to find the interesting part of an image, all it does is trim the most boring parts (found by estimating image entropy) off the longest axis until the image is square.

The idea is that the most common use for smartcrop is to square up images so that you can display a large number of images with different aspect ratios in a nice grid. This is a much simpler problem than trying to find the centre of interest in a picture.

from bimg.

Dynom avatar Dynom commented on May 20, 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: https://github.com/jcupitt/libvips/blob/c79f64ab7def94b23ca65abf46c4ca9e97e3c5db/libvips/conversion/smartcrop.c

from bimg.

greut avatar greut commented on May 20, 2024

should be closed by #145

from bimg.

h2non avatar h2non commented on May 20, 2024

Smartcrop feature has been shipped in v1.0.8. Thank you @greut!

from bimg.

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.