<commit_before>filename="$1"
extension="${filename##*.}"
filestart="${filename##*/}"

num=`convert $1 -coalesce -format "%s\n" info: | tail -n 1`

echo "TinyScreen video conversion"
echo $num "frames to convert"
rm -f temp.gray
rm -f temp.bmp
rm -f "${filestart%.*}.tsv"
for ((i=0; i<=num; i++)); do
convert $1[$i] -resize 96x64! -evaluate multiply 1.25 "temp.bmp"
convert temp.bmp -channel B -evaluate and 57344 -channel G -evaluate and 57344 -evaluate divide 8 -channel R -evaluate and 49152 -evaluate divide 64 +channel -separate -background black -compose plus -flatten "temp.gray"
cat temp.gray >> "${filestart%.*}.tsv"
done
rm -f temp.gray
rm -f temp.bmp<commit_msg>Update converttotsv.sh<commit_after>filename="$1"
extension="${filename##*.}"
filestart="${filename##*/}"

num=`convert $1 -coalesce -format "%s\n" info: | tail -n 1`

echo "TinyScreen video conversion"
echo $num "frames to convert"
rm -f temp.gray
rm -f temp.bmp
rm -f "${filestart%.*}.tsv"
for ((i=0; i<=num; i++)); do
convert $1[$i] -resize 96x64! -evaluate multiply 1.25 "temp.bmp"
# add option for 8/16 bit output here:
convert temp.bmp -channel B -evaluate and 57344 -channel G -evaluate and 57344 -evaluate divide 8 -channel R -evaluate and 49152 -evaluate divide 64 +channel -separate -background black -compose plus -flatten "temp.gray"
cat temp.gray >> "${filestart%.*}.tsv"
done
rm -f temp.gray
rm -f temp.bmp

{'fraction_non_alphanumeric': 0.16798277099784636, 'fraction_numerical': 0.04522613065326633, 'mean_word_length': 4.300380228136882, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1251198', 'n_tokens_mistral': 546, 'n_tokens_neox': 485, 'n_words': 175}