8bit sprite for memory ROM

8bit
palette
low-fi
nes
eeprom

(http://4232.cf) #1

It would like me a plugin 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


256 color pallet cycling
#2

Do you mean you want to find matching 8x8 tiles from which to rebuild a full image from - a sort of basic compression?

I find your question difficult to understand, sorry!


#3

I think @bazza would like to reduce his image into basic building blocks that he could reuse. These blocks would be a part of a general sprite sheet. Ubiquitous among early video games where memory was scarce.


(http://4232.cf) #4

yes. 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


#5

So you would like to generate these blocks (256 of them) from the largest image and then use them to build other images.

Besides looking for answers in this forum, I suggest you visit forums.wesnoth.org. I used to follow their development, esp. the art side, because it was so interesting. There have been discussions about sprite sheets but I don’t know whether they are relevant to you.


(http://4232.cf) #6

I thought in gmic by that it is more intelligent. I can do it with imagemagick.


#7

I am sure it is possible with G’MIC. I am just not the right person to ask. But I can certainly clarify your questions :rofl:. Could you please share the equivalent commands? That way people may know exactly what you would like to do with G’MIC.


(http://4232.cf) #8
#!/bin/bash

convert -crop 8x8 capi.png -compress none a-%010d.ppm

LISTA=$(fdupes .)


echo "$LISTA" | grep "^$" -B 1 | grep "^./" | while read A; do
	echo "$LISTA" | grep "^$" -B 1 | grep "^./" | sort -R | while read B; do
		[ "$B" == "$A" ] && continue
		C=$(diff $A $B | wc -c)
		echo $A $B $C
		if [ "$C" -lt "700" ]; then
			cp $A $B
			# similar
		fi
	done
done


# clean file duplicated
fdupes -r1 . | sed -e 's/\(\w\) /\1|/g' -e 's/|$//' > files
while read line; do
        IFS='|' read -a arr <<< "$line"
        orig=${arr[0]}
        for ((i = 1; i < ${#arr[@]}; i++)); do
                file="${arr[$i]}"
                echo $file
                #sleep 1
                ln -sf "$orig" "$file"
        done
done < files
rm files


# join

N=0
$(echo "convert ( "
ls a-*ppm | while read A; do
    echo $A
    N=$((N+1))
    [ "$N" == "32" ] && echo " +append ) (" && N=0
done
echo ") -background none -append nam.png")

imagick and very much bash

capi


(G'MIC staff) #9

Hello.
That’s interesting, and indeed I guess we can do something with G’MIC.
I’ll give a try maybe tonight :slight_smile:


(http://4232.cf) #10

If you wish it I send examples


(G'MIC staff) #11

Well, sorry, I had finally no time for this.
I’m really running out of time these days, as I recently got new responsibilities at work.
Maybe someone else will be able to propose a solution :slight_smile:


(Lyle Kroll) #12

There’s already a Degradation>Oldshool 8-bit G’MIC preset but the block size isn’t really easily settable. :slight_smile:


(http://4232.cf) #13

but this image is real 8bit. It uses tiles to build an image.
Afterwards of this process can store in MEMORY ROMs

capi.nes run with nestopia and other emulators


(Lyle Kroll) #14

Only GIMP specific way I can think of is Blur>Pixelize and then reduce colors to 8-bit. :slight_smile:

Daffodib


(http://4232.cf) #15

good, but no real 8bit image :blush:


(http://4232.cf) #16

nam-2nam-3

Different quality

Although it is not a very intelligent program, It likes me the result :

#!/bin/bash

mkdir nam
mkdir nam1
rm nam/a-*m
rm nam1/a-*m
convert -crop 8x8 $1 -depth 2 -colors 4 -compress none nam/a-%010d.xpm
convert -crop 8x8 $1 -depth 2 -colors 4 -compress none nam1/a-%010d.xpm

cd nam

# quita las cabeceras
mogrify -sample $2 *
sed -i $sed '/^s/d' *

LISTA=$(fdupes . | grep "^$" -B 1 | grep "^./" )

# quita los duplicados
fdupes -r1 . | sed -e 's/\(\w\) /\1|/g' -e 's/|$//' > files
while read line; do
        IFS='|' read -a arr <<< "$line"
        orig=${arr[0]}
        for ((i = 1; i < ${#arr[@]}; i++)); do
                file="${arr[$i]}"
                #sleep 1
                ln -sf "$orig" "$file"
        done
done < files
rm files


ls -F ../nam | grep -v @ | while read A; do
	cp ../nam1/$A ../nam/$A
done

# join
rm ../nam.png
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")

(http://4232.cf) #17

http://radar.spacebar.org/f/a/weblog/comment/1/1157

Interesting project that uses sprite limited to generate imagenes 8bits


(http://4232.cf) #18

I have these pieces and want to generate an image:

2018-07-07-211050_134x136_scrot

this image

logo

Somebody knows of some intelligent mosaic?


#19

As I said before, I know what you want and that it is possible, but this is outside of my league. If the tools already exist, why not use them instead and then import the resources to your app of choice?


(http://4232.cf) #20

It does not attain good results and does not work with palette of sprites:

metapixel -w 8 -h 8 --antimosaic palette.png --metapixel in.png out.png

w

It is a bad result