Initial commit

This commit is contained in:
Ben Grant
2022-07-10 02:44:55 -07:00
commit 0b08cb21b7
193 changed files with 116 additions and 0 deletions

11
scripts/crop-one.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
# convert a full frame to one that's cropped to only the interesting part and scaled to 256 pixels
# wide. the "throbber" images are played in a loop by plymouth.
# ex. frames/0001.png -> blåhaj/throbber-0001.png
in="$1"
out=blåhaj/throbber-$(basename "$in")
ffmpeg -loglevel quiet -i "$in" -vf crop=806:529:1517:716,scale=256:-1 -y "$out"
# optional, makes output files a bit smaller
optipng -o7 -silent "$out"

4
scripts/crop.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
# just calling crop-one.sh on every PNG in frames/
find frames -type f -name '*.png' | parallel --bar --jobs $(nproc) ./scripts/crop-one.sh

20
scripts/fade-one.py Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
# this script creates a second version of the animation that fades out over time. these files are
# animation-XXXX.png. i think plymouth could use this to smooth the transition to the login screen,
# although it doesn't seem to be used for me.
import os
import re
import sys
digits = re.compile(r'\d+')
# like blåhaj/throbber-0001.png
filename = sys.argv[1]
num = int(digits.search(filename).group())
# fades from 1.0 to 1/60 over the animation
opacity = (61 - num) / 60
output = filename.replace('throbber', 'animation')
os.system(f'ffmpeg -loglevel quiet -i {filename} -vf colorchannelmixer=aa={opacity} -y {output}')
os.system(f'optipng -o7 -silent {output}')

4
scripts/fade.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
# run fade-one.py on every throbber image in parallel
find blåhaj -type f -name 'throbber-*.png' | parallel --bar --jobs $(nproc) ./scripts/fade-one.py