Nimbin[12]?SDL & Graphics / SDL_Game_CPP / scripts/sprites/image_fix_96x64_to_64x64.sh

SDL_Game_CPP git · main

SDL game in C++

sdl game c++ · first commit 2026-03-24 · last commit 2026-03-24 (8 months ago) · synced 1 hour ago · upstream: codeberg.org/Studying_at_HsNR/SDL_Game_CPP

C++ 99.3%
git clone https://git.christianimmanuel.de/sdl-graphics/SDL_Game_CPP.gitwget https://git.christianimmanuel.de/sdl-graphics/SDL_Game_CPP/archive/SDL_Game_CPP.tar.gz
scripts/sprites/image_fix_96x64_to_64x64.sh 593 B · 21 lines raw
#!/bin/sh

input="../Pixel_Crawler/Entities/Mobs/Skeleton Crew/Skeleton - Base/Death/Death-Sheet_shifted.png"
tmpdir="frames_tmp"
output="../Pixel_Crawler/Entities/Mobs/Skeleton Crew/Skeleton - Base/Death/Death-Sheet_processed.png"

mkdir -p "$tmpdir"

# 1. split into 8 × 96x64 frames
convert "$input" -crop 96x64 +repage "$tmpdir/frame_%02d.png"

# 2. crop each from 96x64 to 64x64
for f in "$tmpdir"/frame_*.png; do
    convert "$f" -crop 64x64+16+0 +repage "$f"
done

# 3. recombine horizontally
magick convert +append "$tmpdir"/frame_*.png "$output"

rm -rf $tmpdir
echo "done: $output"