Nimbin[12]?SDL & Graphics / SDL_Game_CPP / scripts/sprites/image_fix_4x_32_to_64.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_4x_32_to_64.sh 711 B · 22 lines raw
#!/bin/sh
set -e

input="../Pixel_Crawler/Entities/Mobs/Skeleton Crew/Skeleton - Base/Death/Death-Sheet.png"
output="../Pixel_Crawler/Entities/Mobs/Skeleton Crew/Skeleton - Base/Death/Death-Sheet_padded.png"

# 1. Crop into 4 frames (32×32 each)
magick "$input" -crop 32x32 +repage frame_%d.png

# 2. Pad each to 64×64 with transparent background
for f in frame_*.png; do
    magick "$f" -background none -gravity center -extent 64x64 "padded_$f"
done

# 3. Explicitly list padded frames to avoid shell glob issues
frames=$(printf 'padded_frame_%d.png ' 0 1 2 3)

# 4. Recombine into a single horizontal strip (256×64)
magick convert +append $frames "$output"

# 5. Cleanup
rm frame_*.png padded_frame_*.png