summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-02-18 12:43:10 -0500
committerJune McEnroe <june@causal.agency>2018-02-18 12:43:10 -0500
commit5a5959a2b00c19ef43d7b992e5c81f6566e67f7f (patch)
tree7aa4acb3e871348e3c66c81dc3f1d13e6b8ca494
parentAlways dump truecolor PNG in gfxx (diff)
downloadsrc-5a5959a2b00c19ef43d7b992e5c81f6566e67f7f.tar.gz
src-5a5959a2b00c19ef43d7b992e5c81f6566e67f7f.zip
Add pngo to README
-rw-r--r--bin/README10
-rw-r--r--bin/pngo.c8
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 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);