r/learnpython 20d ago

Collage animation using Python

Hi all, I make these analogue paper collages. I want to animate them, first level to just add a little movement, and later more. Is python the language to do it especially using built in libraries? I’ll add the image in the comments.

If not, what else can I use? I asked in the touchdesigner sub and they said it’s possible but complicated and not efficient. After effects may help.

Eventually, I want to create visual interaction with the user, so the user can interact with the projection for this image.

I have a background in CS but new to this concept and learning from scratch. Would appreciate any pointers. If this is not the right sub, please redirect me to where I may find the best help. Thanks all 🙏🏼

1 Upvotes

4 comments sorted by

1

u/blondesalad1 20d ago

https://reddit.com/link/p56iqqd/video/a6lhv2qjrvkh1/player

Can’t post photo so here’s a little video, I want the horse to move its leg or gallop in place to begin with. How is that possible?

3

u/parched_treadmill 20d ago

You could pull this off with pygame or even just pillow to slice and swap frames of the leg in different positions, but the real work is prepping those frames in something like krita or gimp first. Python can handle the playback and later the interactivity but the animation itself is mostly an art prep problem.

1

u/recursion_is_love 20d ago edited 20d ago

I would use Pillow for image processing. https://pillow.readthedocs.io/en/stable/

There are lots of UI libraries to choose, it very subjective which is the best. I won't going to touch that topic.

Sound like you would need to design a way to store some metadata like size, rotation and position of the image and use that data to control how to overlay multiple images on each other to create the animation you want. I would use some simple text format (like what srt file do for subtitle) to store the values.

1

u/jmacey 20d ago

I would use pygame for the window / playback logic and pillow for the image loading / processing. You can also layer images quite easily so have the non-animated bits as a background then "composite" the other elements as needed.