Hi asepriters,
I’ve been struggling to export pixel art animations in good quality.
Because my animations have varying frame durations, my export options are limited:
-
GIF export: as GIFs have 8 bit color palette this causes visible color flickering across frames, as the palette is reevaluated on each frame. Sometimes I get lucky and it’s not visible.
-
WebP: this seems to be a true color format, but I’m still looking for software that can convert this back to a mp4. (ffmpeg does not support it yet)
-
PNG sequence
This is the only viable option I have so far, but the process is quite involved:
- Export the png frames
- Export a JSON of all the frames to get the durations
- I’m using SublimeText’s multi cursor to “quickly” manipulate the file to produce a *.ffconcat file from the JSON:
from this
{ "frames": {
"0": {
"frame": { "x": 0, "y": 0, "w": 77, "h": 85 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 77, "h": 85 },
"sourceSize": { "w": 77, "h": 85 },
"duration": 100
},
"1": {
"frame": { "x": 77, "y": 0, "w": 77, "h": 85 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 77, "h": 85 },
"sourceSize": { "w": 77, "h": 85 },
"duration": 100
},
to this:
ffconcat version 1.0
file frames1.png
duration 150
file frames2.png
duration 75
file frames3.png
duration 25
file frames4.png
duration 150
- Then finally convert it to a mp4 using ffmpeg:
ffmpeg -i frames.ffconcat -c:v libx264 -filter:V "setpts=PTS*0.001,scale=-2:840:flags=neighbor" -pix_fmt yuv420p -preset faster -tune stillimage -shortest frames.mp4
This is also upscaling to a certain size.