Nimbin[12]?SDL & Graphics / mapcreator / scripts/sprites/image_fix_4x_32_to_64.sh

mapcreator git · master

SDL3 2.5D game and engine using assets, with map editor

sdl3 c++ game engine map-editor cmake · first commit 2025-10-31 · last commit 2026-09-07 (1 month ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/sdl-spieleentwicklung/map_creator

C++ 99.3%
git clone https://git.christianimmanuel.de/sdl-graphics/mapcreator.gitwget https://git.christianimmanuel.de/sdl-graphics/mapcreator/archive/mapcreator.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