Post subject: PNGOUT recently got updated
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
http://advsys.net/ken/utils.htm along with that most excellent frontend PNGGauntlet: http://benhollis.net/software/pnggauntlet/
i imgur com/QiCaaH8 png
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Looking through the changelog linked from there it looks like the only change is in one of the command line options as opposed to anything in the algorithm. Thanks for bringing this to our attention, though.
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
and as for PNGGauntlet (excellent for batch optimizations), the main difference I've seen is in the user-interface bells and whistles made available by moving from .NET 2.0 to .NET 3.5
i imgur com/QiCaaH8 png
juef
He/Him
Player (154)
Joined: 1/29/2007
Posts: 208
Location: Québec, Canada
Interesting, I had heard about this tool, but didn't know it could compress better than optiPNG in some situations. I guess it's best to run both utilities to make sure images are optimized as much as possible. Speaking of file optimizations... Has anyone used jpegoptim a little? The optimization level is surprisingly good, so much that I'd wonder if it's really lossless. Perhaps there is an image decoder than can compare two images and tell if they're exactly the same?
Joined: 10/3/2005
Posts: 1332
Hypothetically, you could convert both the uncompressed and "lossless" compressed to raw, and see if the checksums of the raw images are the same. I guess I could test that hypothesis instead of just talking about it, but... eh. Effort. :P
Player (36)
Joined: 9/11/2004
Posts: 2630
I just confirmed that it's completely lossless. Methodology: Took initially uncompressed png and pngout'd png converted to bmp took md5sums of both observed that both had the same md5sum
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
arflech
He/Him
Joined: 5/3/2008
Posts: 1120
I learned about PNGOUT and also DeflOpt from this page: http://tasvideos.org/HowToMakePNG.html Now I obsessively compress large batches of PNGs using PNGOUT and then run DeflOpt on them. and I have a new obsession: doing the same with JPGs (using the lossless method of rejiggering the Huffman tables in jpegoptim)
i imgur com/QiCaaH8 png
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
arflech wrote:
Now I obsessively compress large batches of PNGs using PNGOUT and then run DeflOpt on them.
One thing that you can sometimes try is to reduce the amount of colors in the image to 256 (or sometimes even less). With some images, such as GUI screenshots and such, 256 colors is completely sufficient to convey what you want to show, and it can make the png file significantly smaller. In fact, I do this so often that I have actually made a zsh function which automatizes the whole process (reduces the amount of colors and then runs optipng and pngout on the result). It might work on other shells as well:
reducecolors () {
        if [ "$2" = "" ]
        then
                echo "Usage: reducecolors <infile> <outfile> [<colors>]"
        else
                if [ "$3" = "" ]
                then
                        echo "Reducing $1 to $2 with 256 colors..."
                        convert -colors 256 +dither "$1" "$2"
                else
                        echo "Reducing $1 to $2 with $3 colors..."
                        convert -colors "$3" +dither "$1" "$2"
                fi
                if [ $? = 0 ]
                then
                        echo "optipng..."
                        optipng -o 7 -q "$2"
                        echo "pngout..."
                        pngout -q "$2"
                fi
        fi
}
(Note that it turns dithering off when reducing the amount of colors because dithering really kills compression ratios, and with most of the intended images dithering is unneeded.)
Tub
Joined: 6/25/2005
Posts: 1377
<ot> bash has
COLORS=${3:-256}
to assign $3 if set and 256 if unset. Saves you an IF. </ot>
m00
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Tub wrote:
<ot> bash has
COLORS=${3:-256}
to assign $3 if set and 256 if unset. Saves you an IF. </ot>
Seems to work in zsh as well. Hence the function would become:
reducecolors () {
        if [ "$2" = "" ]
        then
                echo "Usage: reducecolors <infile> <outfile> [<colors>]"
        else
                echo "Reducing $1 to $2 with ${3:-256} colors..."
                convert -colors "${3:-256}" +dither "$1" "$2"
                if [ $? = 0 ]
                then
                        echo "optipng..."
                        optipng -o 7 -q "$2"
                        echo "pngout..."
                        pngout -q "$2"
                fi
        fi
}