aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-09-20 16:14:21 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-09-20 16:14:21 -0700
commit34ef84fc60599f44bb61a1d440381aa7e14c1ab6 (patch)
treee67963fb99742d35b589f26fcefc86ec1994031b
parentdea3e2423a496c8908c943af721ed331acde60ad (diff)
downloadabc80sim-34ef84fc60599f44bb61a1d440381aa7e14c1ab6.tar.gz
abc80sim-34ef84fc60599f44bb61a1d440381aa7e14c1ab6.tar.xz
abc80sim-34ef84fc60599f44bb61a1d440381aa7e14c1ab6.zip
screenshot: set some compression parameters
Set a few compression parameters which seem to result in at least somewhat better compression.
-rw-r--r--screenshot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/screenshot.c b/screenshot.c
index 454de5e..b4f1928 100644
--- a/screenshot.c
+++ b/screenshot.c
@@ -8,6 +8,7 @@
#include "hostfile.h"
#include <png.h>
+#include <zlib.h>
const char *screen_path;
@@ -287,6 +288,9 @@ static int do_screenshot(SDL_Surface *surf, struct allocable *a)
png_set_tIME(a->png, a->png_info, &png_now);
+ png_set_compression_level(a->png, Z_BEST_COMPRESSION);
+ png_set_compression_strategy(a->png, Z_FILTERED);
+
if (npalette > 0)
png_set_PLTE(a->png, a->png_info, a->palette, npalette);