8bit artwork for EEPROM and ROM

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
bazza
Posts: 20
Joined: 2016-06-15T18:06:36-07:00
Authentication code: 1151
Location: Argntina

8bit artwork for EEPROM and ROM

Post 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
Post Reply