Bitmapflow is a tool to help you generate inbetweens for animated sprites. In other words, it makes your animations smoother. It uses optical flow to try to guess how the pixels move between frames, and blends them accordingly. The results are far from perfect, and probably require some editing by hand afterwards, but sometimes it can produce decent results.
It supports loading and saving animated gifs, spritesheets and individual frames.
You can download the executables here. (Windows and Linux only for now). On Windows, you'll need to install the Visual Studio Redistributable first (unless you already have Visual Studio 2015 or newer installed). On Linux, you'll need to install OpenCV 4.2, see the releases page for more details. Other than that, it should work out of the box.
A short summary:
examplesfolder in this repository.
If you use big sprites with lots of frames, you may need to wait a while after tweaking the parameters for the processing to complete, since calculating optical flow can be quite CPU intensive.
A short explanation of the parameters follows.
I could explain all the advanced parameters in detail, but since they describe internal optical flow algorithm parameters, they require some background knowledge about the algorithm before they start to make sense. You can check the official documentation for SimpleFlow or the official documentation for DenseRLOF for more details.
You'll need to experiment a lot to find parameters that work well, although the default parameters seem to work decently for a lot of sprites. See my video tutorial on the subject.
The algorithm works best for sprites that only have movement in the two-dimensional plane. That means, things only move horizontally, vertically, or diagonally, not towards or away from the viewer.
Additionally, the algorithm assumes the brightness of pixels doesn't change between frames. That means, things like explosions, particle effects and blinking lights won't work that well, because they generally start bright and become dimmer over time.
Finally, if you feed pixel art into the program, make sure the pixel art isn't upscaled. It should be at its original resolution.
If you want to dig through the source code and compile Bitmapflow yourself, you'll need to jump through some hoops. The program is written in Godot using godot-rust, so the project consists of two parts:
To get it to work, you'll need to install the following things on your system first:
I'm going to assume you're on Windows, but technically speaking this should work on other platforms as well, but the details and filenames will be different.
Getting it to work:
rustfolder and run
cargo build --release. (Note: the crate requires that it is inside of a Git repostory, otherwise it will fail to build. This may not be the case if you downloaded the source code from the Releases page. In that case, run
git initto create a
.gitfolder as a workaround)
rust/target/releasefolder (On Linux this file will be called
libbitmapflow_rust.so). Copy this file to the
On Windows, the program crashes after the splash screen, or I get an error about vcruntime140.dll not being found. What to do?
On Windows, when exporting I get an error similar to "Failed to save spritesheet as [name]; Access is denied (os error 5)."
I get some weird OpenCV error about sizes or something after loading my sprite?
The code is licensed under MIT. The included example sprites (in the
examples folder) are licensed as follows: