Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node to cut an image out from its background and un-blend the translucent pixels #986

Open
Tracked by #912
Keavon opened this issue Jan 22, 2023 · 0 comments
Open
Tracked by #912
Labels
Feature New feature or request Rust Involves Rust programming for the backend

Comments

@Keavon
Copy link
Member

Keavon commented Jan 22, 2023

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.
@Keavon Keavon added Feature New feature or request Available Rust Involves Rust programming for the backend labels Jan 22, 2023
@Keavon Keavon added P-Low and removed P-Medium labels May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request Rust Involves Rust programming for the backend
Projects
Status: Longer-Term
Development

No branches or pull requests

1 participant