Skip to content

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

Description

@Keavon

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      Longer-Term

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions