| |
Cupid
Registered: Jan 2002 Posts: 84 |
Bash script to generate screenshot animations
Hey, as I am posting a lot of fonts right now I thought I wanted to automate creating the animated screenshot and resize the 320x200 PNG files to the necessary 384x272 at the same time.
You can use the following bash script with FFMPEG (https://ffmpeg.org/):
fromwidth=320
towidth=384
fromheight=200
toheight=272
borderadd=-border
animationname=-animation.gif
framerate=1.2
ypad=$((toheight-fromheight))
xpad=$((towidth-fromwidth))
padstring=[0]pad=w=$xpad+iw:h=$ypad+ih:x=$((xpad/2)):y=$((ypad/2)):color=black
ffmpeg -i $1%d.png -pix_fmt rgb24 -filter_complex "$padstring" $1$borderadd%d.png
ffmpeg -f image2 -framerate 1.2 -i $1$borderadd%d.png -loop 1 $1$animationname
I saved this as "build.sh" and using
$bash build.sh fatumfont
takes fatumfont1.png and fatumfont2.png, resizes each and saves them as fatumfont1-border.png and fatumfont2-border.png and creates an animated GIF of both of them with ~600ms in between the frames saved as fatumfont-animation.gif |
|
| |
Krill
Registered: Apr 2002 Posts: 3065 |
My go-to solution is ImageMagick.
$ cat makegif.sh
convert ./ambercow.png -resize 100%x106.78% -gravity center -extent 384x290 ambercow_pal.png
convert ./lovecats.png -resize 100%x133.33% -gravity center -extent 384x290 lovecats_ntsc.png
convert ./mule.png -resize 100%x110.17% -gravity center -extent 384x290 mule_paln.png
convert ./starquake.png -resize 100%x106.78% -gravity center -extent 384x290 starquake_pal.png
convert ./challenge.png -resize 100%x133.33% -gravity center -extent 384x290 challenge_ntsc.png
convert -delay 200 -loop 0 ambercow_pal.png lovecats_ntsc.png mule_paln.png starquake_pal.png challenge_ntsc.png Transwarp.gif |
| |
Cupid
Registered: Jan 2002 Posts: 84 |
Also cool.
I just added creating the d64 of all prg files in the folder, too:
fromwidth=320
towidth=384
fromheight=200
toheight=272
borderadd=-border
animationname=-animation.gif
framerate=1.2
ypad=$((toheight-fromheight))
xpad=$((towidth-fromwidth))
padstring=[0]pad=w=$xpad+iw:h=$ypad+ih:x=$((xpad/2)):y=$((ypad/2)):color=black
ffmpeg -i $1%d.png -pix_fmt rgb24 -filter_complex "$padstring" $1$borderadd%d.png
ffmpeg -f image2 -framerate 1.2 -i $1$borderadd%d.png -loop 1 $1$animationname
cc1541_mac -n $1 $1.d64
for file in *.prg; do
cc1541_mac -f ${file/\.prg/} -w ${file##*/} $1.d64
done |
| |
chatGPZ
Registered: Dec 2001 Posts: 11499 |
now fiddle with vice options and you dont even have to make the screenshots... sth like
x64sc -default -console -exitscreenshot foo.png -limitcycles 10000000 bla.prg |
| |
tlr
Registered: Sep 2003 Posts: 1802 |
Quote: My go-to solution is ImageMagick.
$ cat makegif.sh
convert ./ambercow.png -resize 100%x106.78% -gravity center -extent 384x290 ambercow_pal.png
convert ./lovecats.png -resize 100%x133.33% -gravity center -extent 384x290 lovecats_ntsc.png
convert ./mule.png -resize 100%x110.17% -gravity center -extent 384x290 mule_paln.png
convert ./starquake.png -resize 100%x106.78% -gravity center -extent 384x290 starquake_pal.png
convert ./challenge.png -resize 100%x133.33% -gravity center -extent 384x290 challenge_ntsc.png
convert -delay 200 -loop 0 ambercow_pal.png lovecats_ntsc.png mule_paln.png starquake_pal.png challenge_ntsc.png Transwarp.gif
+1
ImageMagick is great for this! |
| |
bepp
Registered: Jun 2010 Posts: 267 |
If you're into drag n drop, you can use this tool. https://csdb.dk/release/?id=125943. Very simple to use! |
| |
Cupid
Registered: Jan 2002 Posts: 84 |
I am into drag and drop, but not into installing, so I created a web version:
https://codepo8.github.io/CSDB-screen-generator/ |
| |
Krill
Registered: Apr 2002 Posts: 3065 |
Yeah, why run stuff on your own machine when you can on somebody else's? :) |