bazza
(http://4232.cf)
November 29, 2017, 12:00am
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
Hello.
That’s interesting, and indeed I guess we can do something with G’MIC.
I’ll give a try maybe tonight
1 Like
bazza
(http://4232.cf)
November 29, 2017, 4:24pm
10
If you wish it I send examples
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
lylejk
(Lyle Kroll)
December 1, 2017, 12:22am
12
There’s already a Degradation>Oldshool 8-bit G’MIC preset but the block size isn’t really easily settable.
bazza
(http://4232.cf)
December 1, 2017, 2:16am
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
lylejk
(Lyle Kroll)
December 1, 2017, 2:32am
14
Only GIMP specific way I can think of is Blur>Pixelize and then reduce colors to 8-bit.
bazza
(http://4232.cf)
December 1, 2017, 2:36am
15
good, but no real 8bit image
bazza
(http://4232.cf)
December 1, 2017, 6:04pm
16
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")
bazza
(http://4232.cf)
July 6, 2018, 6:50pm
17
http://radar.spacebar.org/f/a/weblog/comment/1/1157
Interesting project that uses sprite limited to generate imagenes 8bits
bazza
(http://4232.cf)
July 8, 2018, 12:14am
18
I have these pieces and want to generate an image:
this image
Somebody knows of some intelligent mosaic?
afre
(Alan)
July 8, 2018, 3:31am
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?
bazza
(http://4232.cf)
July 8, 2018, 3:50am
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
It is a bad result
afre
(Alan)
July 8, 2018, 4:18am
21
The more examples you give the better. If you link to a research paper or two, even better. That would give @David_Tschumperle and the other brilliant minds of G’MIC good reference points.
bazza
(http://4232.cf)
July 8, 2018, 2:42pm
22
I improve a bit but metapixel Generates dither
afre
(Alan)
July 8, 2018, 8:47pm
23
Looks better. Would smaller sprites help?
bazza
(http://4232.cf)
July 8, 2018, 10:52pm
24
The texture/dither is due to an error of the program. This says me the author
http://www.complang.tuwien.ac.at/schani/metapixel/
bazza
(http://4232.cf)
July 9, 2018, 12:10am
25
I did it
convert $NOMBRE.png -dither None -remap mosaico.png png32:$NOMBRE.f.png
metapixel -w 8 -h 8 -d 1 --antimosaic mosaico.png --metapixel $NOMBRE.f.png $NOMBRE.w.png
convert $NOMBRE.f.png -resize 32x30 -scale 256 - | \
composite -compose difference $NOMBRE.f.png - - | \
convert - -resize 32x30 -scale 256 -contrast -threshold .5% mask.png
convert -size 256x240 tile:$NOMBRE.f.png tile:$NOMBRE.w.png mask.png -composite $NOMBRE.w.png
convert $NOMBRE.w.png -dither None -remap mosaico.png $NOMBRE.bmp
2 Likes
bazza
(http://4232.cf)
August 2, 2018, 1:59am
27
These sprites generate them with imagick
game 8bit for arduino/qudino with tvout