I’m experimenting moving my gif making workflow over to Krita. (Making gifs from video clips, that is.) For this, I need to be able to decrease the frame density. So I’ve imported a short clip at 24 FPS, but for size restrictions, I want to keep only, say, every 2nd or 3rd frame of my animation. I don’t want to have to select the frames to be deleted all manually.
I don’t see a way to do this currently. Is this correct?
If I were to write a plugin for this, how do I even access frames via Python? I have my layer node and it has the animated property, but where are the frames stored?
I can’t think of how to do that in Krita, but I have one idea for a workaround. I don’t know what video editor you use, I’ve been using Kdenlive mostly. If you import the clip and export it at 200% speed but at the original frame rate, then that will delete every other frame. Still not sure how to get every 3rd frame… maybe 300%? Seems worth a try.
Now wondering: In the UI I am able to select multiple frames and once and remove them in one go. Does anyone know if I can select multiple frames in Python? The tutorial linked above only shows how to set the current frame/playhead.
(I can work with deleting one frame at a time, though the code might be a bit easier/more performant if I can select and delete them all in one go.)
(EDIT: I moved the post to the plugins section, since we are now in coding territory )
On import I don’t know yet how long the result will be (I might clip it during editing) or how well the exported gif compressess, so I don’t know how many frames I need to drop. Sometimes it takes several tries with several exports to get the best trade-off between fie size and smoothness. So I want to avoid any extra steps. It’s fine though, I don’t mind the coding, since once it works I’ll get a lot of use out of it.