-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce number of rendered frames when seeking #262
Comments
This comment might help with this fix:
From my understanding, when we are seeking forward, we only render from current frame to the desired one. But when seeking back, we render from the 1st frame in the gif to the desired one. So seeking back is very costly. |
In general to render given frame in GIF all previous frames are needed (see here for more info: http://www.imagemagick.org/Usage/anim_basics/#dispose). In some cases desired frame can be just rendered (if there is no disposals to previous frames). |
The gifs I am using are "do not dispose", so optimized seeking would be beneficial for those gifs. Any thoughts on when this feature might be available? |
I'll do it ASAP but can't promise exact time. Maybe I manage to add this feature this week. |
That would be awesome.Thanks!!! |
It seems that disposal method itself doesn't say anything. Even if it is The simplest optimization idea is to find nearest frame (going backwards from desired one, stopping at the current one) which is equal-sized to canvas and has no transparent pixels. All needed metadata is available without additional processing. |
Mentioned solution can be applied if that frame uses disposal = None. Valid key frame can be also that which uses disposal to background and covers all canvas, it doesn't matter whether it has transparent pixels because we need only draw background in such case. |
I am not sure if the mentioned solution can be applied without modifying the library. |
Exactly I will modify the library to reflect that change. |
Done, available in version 1.1.16-SNAPSHOT. |
Any idea on when 1.1.16 will be out? |
It is SNAPSHOT, not SNAPCHAT. I've just added instructions how to add snapshot repository, to It is not decided yet when 1.1.16 will be released to central repository, it should be at the beginning of may. |
Haha yes, I meant SNAPSHOT. Thanks! |
Seeking forward works really well and no frames are dropped. Now, seeking backwards is a different story. It becomes extremely jittery and drops a lot of frames.
Any idea why this is happening?
The text was updated successfully, but these errors were encountered: