E
E
EboLiK2022-01-31 15:15:16
Image processing
EboLiK, 2022-01-31 15:15:16

How to insert a photo instead of a white background?

I want to make a function that will insert a photo into a white hexagon, i.e. so that the photo is instead of a hexagon, while the photo repeats the shape of a hexagon ... It would probably be more correct to say that a white hexagon is like a chromakey
61f7d2b42e918642933031.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-01-31
@EboLiK

Use PIL (pillow package), in particular PIL.Image.composite() You just need to figure out how to form the correct mask.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question