Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Erik_Bam ! (Registered 2024-05-26) You are not logged in - nap
CSDb User Forums


Forums > CSDb Discussions > Bash script to generate screenshot animations
2022-03-31 20:56
Cupid

Registered: Jan 2002
Posts: 83
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
2022-03-31 21:15
Krill

Registered: Apr 2002
Posts: 2854
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
2022-03-31 21:20
Cupid

Registered: Jan 2002
Posts: 83
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
2022-03-31 21:22
chatGPZ

Registered: Dec 2001
Posts: 11148
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
2022-03-31 21:41
tlr

Registered: Sep 2003
Posts: 1727
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!
2022-04-01 09:25
bepp

Registered: Jun 2010
Posts: 265
If you're into drag n drop, you can use this tool. https://csdb.dk/release/?id=125943. Very simple to use!
2022-04-05 09:59
Cupid

Registered: Jan 2002
Posts: 83
I am into drag and drop, but not into installing, so I created a web version:

https://codepo8.github.io/CSDB-screen-generator/
2022-04-05 10:22
Krill

Registered: Apr 2002
Posts: 2854
Yeah, why run stuff on your own machine when you can on somebody else's? :)
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Oswald/Resource
Peacemaker/CENSOR/Hi..
DnP
Gregfeel/Lepsi De, S..
t0m3000/HF^BOOM!^IBX
zscs
BroneCk/Samar^BooM!
d0c
LightSide
Magnar
Asphodel
grasstust/Hoaxers
DJ Space
Mojzesh/TGR🇬🇧
tlr
katon/Lepsi De
Trurl/Extend
rime/Fancy Rats
Guests online: 79
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 No Bounds  (9.6)
7 Comaland 100%  (9.6)
8 Aliens in Wonderland  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Covert Bitops  (9.4)
2 Nostalgia  (9.4)
3 Oxyron  (9.3)
4 Booze Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 S!R  (9.7)
5 Faayd  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.