I’m doing exports out of aseprite files with the CLI, and I’ve got a lot of empty frames spread across all my animations. When I export those frames it makes quit a load of empty images.
I found that there was a ‘–ignore empty’ funtion in the CLI that supposedly would get rid of them, but I don’t get how to use it.
Actually the --ignore-empty option is useful only for --sheet and not for --save-as.
Anyway I’m not sure how a --save-as ignoring empty frames could work. For example, how would you know how much frames the animation have if there are empty slots between frames? E.g. Having
frame01.png
frame02.png
frame10.png
How do we know that frame03.png…frame09.png are empty frames? Does frame11.png is an empty frame? Or the last frame is frame10.png? How many frames does this animation have?
I’d assume the frame number is set by the position of the frame inside of a given tag.
Once the frame is numbered, it can be deleted if it’s empty. We’d indeed get gaps in the sequence but it doesn’t matter in our case.
That’s pretty specific to our pipeline.
We’re actually exporting every frame of all our *.ase files in order to pack them in a big atlas.
The probleme is that we have a lot of un wanted blank frames in our animations.
I looked for a way to delete blank image files in bash (now that I’ve been converted ), but couldn’t find anything so far.
I went a little further and now I miss just a little something.
for file in D:/00_TAKROG/ATLAS_UNITS_AND_DOODADS_TEMPORARY/*.png; do
convert "$file" -threshold X% -format "%[fx:mean==1?1:0]" info:
done
This returns 1 if the image is NOT blank and 0 if the image IS blank. But I don’t know how to use the returned value in an if statement.
I know this :
for file in D:/00_TAKROG/ATLAS_UNITS_AND_DOODADS_TEMPORARY/*.png; do
convert "$file" -threshold X% -format "%[fx:mean==1?1:0]" info:
if [ ??? = "0" ]; then
echo "$file seems to be blank - removing it..."
rm "$file"
fi
done
For anyone chiming in, here’s what to do to delete empty images in a given folder in windows, in bash.
for file in D:/YOUR_FOLDER_HERE/YOUR_SUBFOLDER_HERE/*.png; do
test=$(convert "$file" -alpha extract -format "%[fx:mean==0?0:1]" info:)
if [ "$test" = "0" ]; then
rm "$file"
fi
done
David, if you end up adding a feature to ignore empty frame at export/saving, I’ll be pretty happy because even if I don’t have to do anything now, automatic deletion takes several tenth of minutes (over 9000 files to check, and around 4000 files to delete).
Anyway, thanks for your help, your awesome
Man you deserve a statue !
That would help us a lot indeed, we just ran a test and it takes over 45 minutes to delete all the empty images.
Thanks again !