Giter VIP home page Giter VIP logo

Comments (1)

kipcole9 avatar kipcole9 commented on June 20, 2024

I think this should move to a discussion rather than an issue.

I'm no expert but I believe the approach you can take is this:

  1. Take your alpha band and dilate it. Dilation will add edge pixels to represent the contour.
  2. Take a copy of this dilated alpha band and colour it any way you want
  3. Compose the base image over the coloured contour image
  4. Add the dilated alpha band to re-establish the transparency.

I can see in your examples you have both a white border and then a feathered dark edge. You can use variations of the above to use more composed layers to get that effect. For example, to get the feathered edge, you can duplicate the dilated alpha band again and use a gaussian blur on it.

I'm sure John and Kleis can be more precise but they are in difference time zones - please take the above as a possible path from someone who is also learning how to do this kind of thing.

from libvips.

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.