I thought in gmic by that it is more intelligent. I can do it with imagemagick.
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 . Could you please share the equivalent commands? That way people may know exactly what you would like to do with G’MIC.
#!/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
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
There’s already a Degradation>Oldshool 8-bit G’MIC preset but the block size isn’t really easily settable.
but this image is real 8bit. It uses tiles to build an image.
Afterwards of this process can store in MEMORY ROMs
Only GIMP specific way I can think of is Blur>Pixelize and then reduce colors to 8-bit.
good, but no real 8bit image
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://radar.spacebar.org/f/a/weblog/comment/1/1157
Interesting project that uses sprite limited to generate imagenes 8bits
I have these pieces and want to generate an image:
this image
Somebody knows of some intelligent mosaic?
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?
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
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.
I improve a bit but metapixel Generates dither
Looks better. Would smaller sprites help?
The texture/dither is due to an error of the program. This says me the author
http://www.complang.tuwien.ac.at/schani/metapixel/
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