diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/README | 10 | ||||
-rw-r--r-- | bin/pngo.c | 8 |
2 files changed, 14 insertions, 4 deletions
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 4db0d11d..14f86579 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); |