Comments (1)
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:
- Take your alpha band and dilate it. Dilation will add edge pixels to represent the contour.
- Take a copy of this dilated alpha band and colour it any way you want
- Compose the base image over the coloured contour image
- 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)
- The position of "#include <vips/vips8>" matters. HOT 2
- distance transform HOT 1
- CMYK -> SRGB conversion results in color change
- vips dzsave crashes when saving tiff to avif HOT 3
- OSError: [Errno 30] Read-only file system: '/my' HOT 1
- Unable to use vips-cpp statically with msvc
- 8.15.2 crashes Erlang VM on NetBSD HOT 11
- webp works in Firefox/breaks in Chrome & libvip
- A certain combination of operations causes 2-3 minute exports HOT 1
- Crash trying to read/decode large Big TIFF File HOT 7
- HEIC to JPEGXL conversion failing in Win11
- Breaking changes and versioning
- VipsForeignLoad: "bmptest.bmp" is not a known file format
- "System.StackOverflowException” in NetVips.dll
- Add an `sdf` operator HOT 1
- vips_vsnprintf own implementation is not thread safe HOT 2
- Improve EXIF handling HOT 5
- Meson does not find vsnprintf on msvc HOT 5
- SVG embedded PNG/JPG dimensions limit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libvips.