Page 1 of 1

8bit artwork for EEPROM and ROM

Posted: 2017-11-28T20:42:02-07:00
by bazza
Image

It would like me a script that look for basic forms ( size: 8x8) and replace them to create image for ROMS, EEPROM, using sprite (8x8) and maps (nam) for the sprite.
Only have 256 characters by image this image uses all the available.

For example: it could look for similar characters and unify them losing quality but reducing space.


My draft script. Requiere similar

Code: Select all

#!/bin/bash
# crop
convert -crop 8x8 $1 -depth 2 -compress none -colors 4 a-%010d.ppm
# list image
LISTA=$(fdupes . | grep "^$" -B 1 | grep "^./" )
echo "$LISTA" | sort -R | while read B; do
	echo "$LISTA" | while read A; do
		[ "$B" == "$A" ] && continue
		C=$(./similar  -m rgb $A $B 2> /dev/null | grep ':'| cut -d" " -f3)
		[ "$C" == "" ] && continue
		[ "$(echo "$C>.5" | bc -l)" == "1" ] && cp $A $B
	done
done
# join
N=0
$(echo "convert ( "
ls a-*m | while read A; do
    echo $A
    N=$((N+1))
    [ "$N" == "32" ] && echo " +append ) (" && N=0
done
echo ") -background none -append nam.png")
Image for example:

Image