adding horizontal band converter

This commit is contained in:
Dagen Brock 2017-05-26 19:12:11 -05:00
parent b5958edf89
commit 2230ee4cc1
24 changed files with 34 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,6 +1,6 @@
#!/bin/bash
# run from parent dir "./tests/run_1.sh"
for i in lion.jpg painting-swirl.jpg pink-cosmos.jpg radiant-color.jpg ;
for i in `ls ../sample_images`
do
./scripts/slicer.sh ../sample_images/$i
done

BIN
horizontal-band-color/out/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,27 @@
#!/bin/bash
IMAGE=$1 # ./something/foo.png
IMAGEBASE=$(basename $IMAGE) # foo.png
IMAGEBASENOEXT=${IMAGEBASE%%.*} # foo
OUTBASE=out
OUTDIR=$OUTBASE/$IMAGEBASENOEXT
mkdir -p $OUTDIR
# start with RGB, so from 200 vertical pixels divided by 16 palettes = 320x12.5 (we'll do 13 and remove extras)
# we'll end up with 13 chunks of 320x13 (last one will be short) that are still full color
convert -resize 320x200! -crop 320x13 $IMAGE $OUTDIR/$IMAGEBASENOEXT-%03d.band.png
# reduce each band to a 16 color palette
for file in `ls $OUTDIR/$IMAGEBASENOEXT*.band.png`;
do
echo Working on splice: $file
filebase=$(basename $file)
filebasenoext=${filebase%%.*}
dither=Riemersma
dither=FloydSteinberg
convert -colors 16 -depth 12 -dither $dither $file $OUTDIR/$filebasenoext.band16.png
done
convert -append $OUTDIR/$IMAGEBASENOEXT*band16* $OUTBASE/$IMAGEBASENOEXT-FINAL.png

View File

@ -0,0 +1,6 @@
#!/bin/bash
# run from parent dir "./tests/run_1.sh"
for i in `ls ../sample_images`
do
./scripts/slicer.sh ../sample_images/$i
done

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
sample_images/eggs.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB