Skip to content

Moh-27SL/compositing-and-matting-PYTHON-EDITION-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Image Compositing and Matting-PYTHON-EDITION-

This project performs simple image compositing and artifact-based color correction using opencv and numpy. It uses PNG input images to isolate and blend foreground and background regions, applying alpha matting logic for compositing.

Example Output

foreground

THATS ME!! (foreground)

-->

alpha * foreground

after artifact removal

-->

background

background

-->

(1-alpha) * background

background after applying alphaM matte map

-->

(1-alpha) * background + alpha * foreground

result

Features

  • Load images (foreground, background, artifact)
  • Apply artifact-based color correction (RGB offset)
  • Generate alpha matte from artifact image with user specified tolerance
  • Composite foreground over background using the matte
  • Save the final blended image

artifact Example (the wall behind the robot)

artifact Example

example map of tolerance = 30, if unspesified tolerance = 0
tolerance map

📦 Dependencies

This project requires the following Python libraries:

  1. NumPy – Fundamental package for numerical computing

  2. OpenCV (cv2) – Computer vision and image processing library

How to Use

  1. Provide images: artifact, foreground, and background.
  2. Run the program — it will generate a result image using the compositing process where you can save the image to enjoy it.

Developed by Mohammed Yasser Mohammed call me ;)

email : [email protected]

Releases

No releases published

Packages

No packages published

Languages