From 5a5959a2b00c19ef43d7b992e5c81f6566e67f7f Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sun, 18 Feb 2018 12:43:10 -0500 Subject: Add pngo to README --- bin/README | 10 ++++++++++ bin/pngo.c | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/README b/bin/README index 947163d3..94429275 100644 --- a/bin/README +++ b/bin/README @@ -75,6 +75,16 @@ their detection. ssh tux.local pbpaste + pngo + +PNG optimizer. Does not support interlaced PNGs. + + - Discards ancillary chunks + - Discards unnecessary alpha channel + - Converts unnecessary truecolor to grayscale + - Applies a simple filter type heuristic + - Applies zlib's best compression + wake Broadcasts a wake-on-LAN packet to one of my machines. diff --git a/bin/pngo.c b/bin/pngo.c index 1dcc8b22..85a58443 100644 --- a/bin/pngo.c +++ b/bin/pngo.c @@ -364,7 +364,7 @@ static void filterData(void) { } } -static void eliminateAlpha(void) { +static void discardAlpha(void) { if (!(header.color & ALPHA)) return; size_t sampleSize = header.depth / 8; size_t pixelSize = 4 * sampleSize; @@ -391,7 +391,7 @@ static void eliminateAlpha(void) { header.color &= ~ALPHA; } -static void eliminateColor(void) { +static void discardColor(void) { if (!(header.color & TRUECOLOR)) return; size_t sampleSize = header.depth / 8; size_t pixelSize = ((header.color & ALPHA) ? 4 : 3) * sampleSize; @@ -462,8 +462,8 @@ static void optimize(const char *inPath, const char *outPath) { scanlines(); reconData(); - eliminateAlpha(); - eliminateColor(); + discardAlpha(); + discardColor(); filterData(); free(lines); -- cgit 1.4.1