From 8935a6ee6d8ece72ff3096d0a6a891f8ce09dd2f Mon Sep 17 00:00:00 2001 From: Teo-CD Date: Mon, 18 Mar 2024 13:15:41 +0000 Subject: [PATCH] Utils: Update conversion command For some gifs, my original convert command mangled the deltas and produced completly wrong frames. This is due to a couple of mistakes in the order of operations 1. The -coalesce option to flatten all layers up to the current frame needs to be before the output, not the input 2. Resizing was done *before* the coalesce option, leading to invalid delta frames and image corruption 3. This was emphasized by the thresholding, making it look mangled. Update the command in the script and the example in the README. --- README.md | 2 +- Utils/convertAnimGif.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aa125af..bfe6898 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ ses images individuelles, et les convertir en un format de bitmap presque correc (aux bits inversés) avec la commande suivante : ```shell -convert -resize 84x48 -coalesce .gif -threshold 50% %02d.mono +convert .gif -coalesce -resize 84x48 -threshold 50% %02d.mono ``` Il peut être nécessaire d'inverser les bits comme mentionné plus haut et je n'ai diff --git a/Utils/convertAnimGif.sh b/Utils/convertAnimGif.sh index d8d33d1..de2ec14 100755 --- a/Utils/convertAnimGif.sh +++ b/Utils/convertAnimGif.sh @@ -40,7 +40,7 @@ for gifToConvert in "$@"; do mkdir "$animDir" pushd "$animDir" - convert -resize 84x48 -coalesce ../"$gifToConvert" -threshold 50% %02d.mono + convert ../"$gifToConvert" -coalesce -resize 84x48 -threshold 50% %02d.mono "$bmp_help" ./*.mono # Clean up and remove the extension rm -f ./*.mono