diff --git a/pngzop_brute.sh b/pngzop_brute.sh deleted file mode 100755 index 58be7ebf2..000000000 --- a/pngzop_brute.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# pngzop_brute.sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Extracts the concatenated data from the IDAT chunks in a set of PNG files, -# recompresses them with zopfli, and embeds them in a new set of PNG files -# with suffix ".png" replaced with "_pngzop_brute.png" - -# Usage: -# pngzop_brute *.png - -# Standard Input: *.png -# Output: *_pngzop_brute.png - -# To do: Adjust zlib CMF to reflect actual windowBits required. - -for x in $* -do - root=`echo $1 | sed -e s/.png$//` - pngzop_get_ihdr.exe < $1 > ${root}_pngzop_brute.png - pngzop_brute_zopfli.sh $1 - pngzop_zlib_to_idat.exe < ${root}.zlib >> ${root}_pngzop_brute.png - rm ${root}.zlib - pngzop_get_iend.exe < $1 >> ${root}_pngzop_brute.png - shift -done diff --git a/pngzop_brute_zopfli.sh b/pngzop_brute_zopfli.sh deleted file mode 100755 index 2a670a77c..000000000 --- a/pngzop_brute_zopfli.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -# png_brute_zopfli.sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Usage: -# png_brute_zopfli.sh file.png [...] - -# Input: *.png, a set of PNG files -# Output: *.zlib, zopfli-compressed IDAT data - -for x in $* -do -root=`echo $1 | sed -e "s/.png$//"` - -# Generate trial PNGs with filter none, 4 PNG filters, and adaptive filter -for f in 0 1 2 3 4 5 -do - pngcrush -q -m 1 -f $f -force $1 ${root}_f$f.png & -done -wait - -# Extract and decompress the zlib datastream from the concatenated IDAT chunks. -for f in 0 1 2 3 4 5 -do - pngzop_get_idat.exe < ${root}_f$f.png | zpipe -d > ${root}_f$f.idat & -done -wait -rm -f ${root}_f?.png - -# Recompress the IDAT data using zopfli -for f in 0 1 2 3 4 5 -do - zopfli --i25 --zlib ${root}_f$f.idat & -done -wait -rm -f ${root}_f?.idat - -# Copy the smallest result to file.zlib -cat `pngzop_smallest.sh ${root}_f?.idat.zlib | tail -1` > ${root}.zlib -rm -f ${root}_f?.idat.zlib - -shift -done diff --git a/pngzop_get_idat.sh b/pngzop_get_idat.sh deleted file mode 100644 index 6e7242ee9..000000000 --- a/pngzop_get_idat.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# png_get_idat.sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Extracts and decompresses the data from the IDAT chunks in a set of -# PNG files. - -# Usage: -# png_get_idat.sh file.png - -# Output: file.idat - -for x in $* -do - root=`echo $1 | sed -e "s/.png$//"` - pngzop_get_idat.exe < $1 | zpipe -d > $root.idat - shift -done diff --git a/pngzop_get_zdat.sh b/pngzop_get_zdat.sh deleted file mode 100755 index be6b8dd76..000000000 --- a/pngzop_get_zdat.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# pngzop_get_zdat.sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Extracts the concatenated data from the IDAT chunks in a set of PNG files, -# leaving it compressed as found. - -# Usage: -# pngzop_get_zdat.sh file.png - -# Output: file.zdat - -for x in $* -do - root=`echo $1 | sed -e s/.png$//` - pngzop_get_idat.exe < $1 > $root.zdat - shift -done diff --git a/pngzop_pngcrush.sh b/pngzop_pngcrush.sh deleted file mode 100755 index d86ecd54c..000000000 --- a/pngzop_pngcrush.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# pngzop_pngcrush.sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Extracts the concatenated data from the IDAT chunks in a set of PNG files, -# recompresses them with zopfli, and embeds them in a new set of PNG files -# with suffix ".png" replaced with "_pngzop.png" - -# Usage: -# pngzop_pngcrush.sh *.png - -# Standard Input: *.png -# Output: *_pngzop.png - -# To do: Adjust zlib CMF to reflect actual windowBits required. - -for x in $* -do - root=`echo $1 | sed -e s/.png$//` - pngzop_get_ihdr.exe < $1 > ${root}_pngzop.png - pngzop_pngcrush_zopfli.sh $1 | pngzop_zlib_to_idat.exe >> ${root}_pngzop.png - pngzop_get_iend.exe < $1 >> ${root}_pngzop.png - shift -done diff --git a/pngzop_pngcrush_zopfli.sh b/pngzop_pngcrush_zopfli.sh deleted file mode 100755 index 30673eb7a..000000000 --- a/pngzop_pngcrush_zopfli.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Usage: -# pngzop_pngcrush_zopfli.sh file.png > file.zlib - -# file.png is a PNG file. -# Standard output is the uncompressed IDAT chunk data, recompressed as a zlib -# datastream. - -root=`echo $1 | sed -e "s/.png$//"` -rm -f ${root}_L9.png - -# Do pngcrush level 9 with none, 4 filters, and adaptive filtering, and -# select the smallest. -pngcrush -q -m 113 -m 114 -m 115 -m 116 -m 117 -m 118 \ - -force $1 ${root}_L9.png - -# Extract and decompress the zlib datastream from the concatenated IDAT chunks. -pngzop_get_idat.exe < ${root}_L9.png | zpipe -d > ${root}_L9.idat -rm ${root}_L9.png - -# Recompress with zopfli and write it on standard output. -zopfli --i25 --zlib -c ${root}_L9.idat - -rm ${root}_L9.idat diff --git a/pngzop_smallest.sh b/pngzop_smallest.sh deleted file mode 100755 index 158b2e3ed..000000000 --- a/pngzop_smallest.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Selects the smaller of file.zdat (extracted from a PNG) or -# file.idat.zlib (same but recompressed with zopfli) - -# picksmallest file1 file... - -# for use on platforms that do not have "ls -S" - -smallest=$1 -smallsize=`ls -l $1 | sed -e " -s/[^ ]*[ ]*\ -[^ ]*[ ]*\ -[^ ]*[ ]*\ -[^ ]*[ ]*\ -//" -e "s/[ ].*//"` - -shift - -for x in $* -do -file=$1 -shift - -size=`ls -l $file | sed -e " -s/[^ ]*[ ]*\ -[^ ]*[ ]*\ -[^ ]*[ ]*\ -[^ ]*[ ]*\ -//" -e "s/[ ].*//"` - -if [ $smallsize -gt $size ] ; then -smallest=$file -smallsize=$size -fi -done - -echo $smallest