adding horizontal band converter
BIN
full-color/out/apple-photo-FINAL-APPX.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
full-color/out/boy-painting-FINAL-APPX.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
full-color/out/chinese-painting-FINAL-APPX.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
full-color/out/eggs-FINAL-APPX.png
Normal file
After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
@ -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
BIN
horizontal-band-color/out/apple-photo-FINAL.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
horizontal-band-color/out/boy-painting-FINAL.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
horizontal-band-color/out/chinese-painting-FINAL.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
horizontal-band-color/out/eggs-FINAL.png
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
horizontal-band-color/out/lion-FINAL.png
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
horizontal-band-color/out/painting-swirl-FINAL.png
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
horizontal-band-color/out/pink-cosmos-FINAL.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
horizontal-band-color/out/radiant-color-FINAL.png
Normal file
After Width: | Height: | Size: 27 KiB |
27
horizontal-band-color/scripts/slicer.sh
Executable 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
|
6
horizontal-band-color/tests/run_1.sh
Executable 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
|
BIN
sample_images/apple-photo.jpg
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
sample_images/boy-painting.jpg
Normal file
After Width: | Height: | Size: 277 KiB |
BIN
sample_images/chinese-painting.jpg
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
sample_images/eggs.jpg
Normal file
After Width: | Height: | Size: 207 KiB |