GraphiteEditor / GraphiteEditor/Graphite
Node to cut an image out from its background and un-blend the translucent pixels
- Langage dominant
- Rust
- Étoiles
- 27.2k
- Forks
- 1.3k
- Merge moyen
- 20 h 5 min
- PR mergées (30 j)
- 57
Description
This node would let you manually cut out a background by "un-premultiplying" the translucent pixels in an image. You feed it:
- The original image with both a foreground and background, where the translucency is "baked in"
- Only the background, without the foreground that's being cut out
- A mask that you paint
The node produces the foreground content cut out using the transparency of the painted mask, with the translucent pixels changed to "un-premultiply" the blending with the background pixels.
(This is sort of conceptually equivalent to un-baking the ambient occlusion from a photoscanned 3D model.)
Example 1:
1. Take a photo (locked in place with a tripod) of someone holding a translucent object and wearing a fuzzy vest
2. Have them leave the frame and shoot another photo of just the backdrop
3. The first photo has features of the backdrop blended into the colors of pixels where the translucent object and edges of the fuzzy vest are (the foreground's translucent pixels are "pre-multiplied" with the background).
4. Manually draw a mask where the translucent parts are some intermediate (gray) strength value.
5. Feed these three inputs into this node and get an output that applies the mask and recolors the translucent pixels to remove the background's color contribution.
Example 2:
1. Take an image with a perfectly solid background color, where you wish the image instead had a transparent background.
2. Pick the color of the background to use as the background image.
3. The original image has the background color contaminating the translucent pixel colors where both the foreground and background color blend to form the resulting color (in areas of anti-aliasing around edges or translucency of the object itself).
4. Make a mask for the object that accounts for the anti-aliased edges and any areas of translucency in the subject.
5. Feed these three inputs into this node and get an output that applies the mask and recolors the translucent pixels to remove the background's color contribution.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
No files, tests, or entry points are named. Start by finding the existing node-graph image-processing conventions and confirm how nodes declare image, background, and mask inputs; the work is done when the new node produces a foreground with the painted transparency and removes the background contribution from translucent pixels as described in the examples.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust
- Domaine
- computer-graphics
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 30/100