Created
April 16, 2019 21:57
-
-
Save a1batross/36469abbc5f9d4fb0e3335f6a438d9a2 to your computer and use it in GitHub Desktop.
HL Steam backgrounds generator based on imagemagick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
file=$1 | |
width=$(identify -format %W $file) | |
height=$(identify -format %H $file) | |
out=BackgroundLayout.txt | |
mkdir -p background | |
echo "resolution $width $height" >> $out | |
convert -crop 256x256 $file +repage background/tile%d.tga | |
num=0 | |
for i in $(seq 0 256 $((height-1))) | |
do | |
for j in $(seq 0 256 $((width-1))) | |
do | |
echo "resource/background/tile$num.tga scaled $j $i" >> $out | |
num=$((num+1)) | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment