{ "name": "pngquant", "version": "2.18.0", "summary": "pngquant: lossy PNG compression to a palette of 256 colours or fewer, with alpha (the last release in C)", "category": "tool", "license": "GPL-3.0-or-later", "homepage": "https://pngquant.org/", "source": { "url": "https://pngquant.org/pngquant-2.18.0-src.tar.gz", "sha256": "e72194b52b36f040deaec49a1ddd5dcd8d4feecc3a5fe6c5e9589a9707b233d4" }, "watch": { "kind": "index", "url": "https://pngquant.org/releases.html", "regex": "pngquant-(2\\.[0-9]+\\.[0-9]+)-src\\.tar\\.gz" }, "deps": [ "libpng", "zlib" ], "env_packages": [], "static": true, "nss": false, "check": "t=$(mktemp -d) && bin/pngquant --version | has '^2\\.18\\.0' && python3 -c 'import sys, zlib, struct; w = h = 32; raw = b\"\".join(b\"\\0\" + bytes(v for x in range(w) for v in ((x * 8) % 256, (y * 8) % 256, ((x + y) * 4) % 256, 255)) for y in range(h)); c = lambda t, d: struct.pack(\">I\", len(d)) + t + d + struct.pack(\">I\", zlib.crc32(t + d)); open(sys.argv[1], \"wb\").write(b\"\\x89PNG\\r\\n\\x1a\\n\" + c(b\"IHDR\", struct.pack(\">IIBBBBB\", w, h, 8, 6, 0, 0, 0)) + c(b\"IDAT\", zlib.compress(raw, 0)) + c(b\"IEND\", b\"\"))' \"$t/a.png\" && s0=$(stat -c %s \"$t/a.png\") && bin/pngquant --speed 1 --quality 40-95 --strip --output \"$t/q.png\" \"$t/a.png\" && s1=$(stat -c %s \"$t/q.png\") && [ \"$s1\" -lt \"$s0\" ] && bin/pngfix \"$t/q.png\" > /dev/null && od -An -tx1 -j25 -N1 \"$t/q.png\" | tr -d ' \\n' | has -x 03 && [ -s share/doc/pngquant/COPYRIGHT ] && echo \"pngquant $(bin/pngquant --version | first): a 32x32 RGBA PNG reduced to a palette PNG ($s0 to $s1 bytes), read by libpng's pngfix without an error; its licence in share/doc/pngquant\"" }