[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107963":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":34,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":38,"discoverSource":39},107963,"slimdeer","heydeer\u002Fslimdeer","heydeer","Smaller images, same picture. Compress PNGs to PNG or WebP with automatic quality. PNG output is 8–12% smaller than TinyPNG at equal quality on the median image. Command line and browser.","https:\u002F\u002Fheydeer.ai\u002Fopen-source\u002Fpngdeer",null,"Rust",581,49,2,0,17,112,3,67.6,"MIT License",false,"main",[24,25,26,27,28,29,30,31,32,33],"cli","color-quantization","image-compression","png","png-compression","rust","tinypng","tinypng-alternative","tinypng-cli","webassembly","2026-11-04 05:09:50","2026-11-23 14:53:51","# slimdeer\n\n**Smaller images. Same picture.** slimdeer makes PNG and JPEG images smaller, or turns them into WebP and AVIF, with no quality slider: for each image it searches for the smallest file whose perceptual score still reaches a target picked for that image. A PNG becomes the palette PNG that does (palette sizes from 2 to 256 colors, with and without dithering): at the same quality, the median image comes out **8–12% smaller than with TinyPNG**, the best result of any open-source compressor we've measured. slimdeer was called pngdeer until version 0.3.0.\n\n**[Try it in your browser →](https:\u002F\u002Fheydeer.ai\u002Fopen-source\u002Fslimdeer)** Nothing is uploaded: images are compressed on your device.\n\n[![slimdeer in the browser](.github\u002Fslimdeer.png)](https:\u002F\u002Fheydeer.ai\u002Fopen-source\u002Fslimdeer)\n\n```bash\nbrew install heydeer\u002Ftap\u002Fslimdeer\nslimdeer logo.png photo.jpg    # writes logo.min.png and photo.min.jpg\n```\n\n- **Picks the quality for you**: about what TinyPNG would give the image, never above 90 on SSIMULACRA2's scale, which is indistinguishable at 1:1.\n- **Same bytes everywhere**: the command line (macOS and Linux) and the browser (WebAssembly, on every core) run the same Rust code and write identical files.\n- **Big images too**: up to 40 megapixels in the browser, more on the command line.\n- **JPEG photos too**: re-encoded with mozjpeg at the lowest quality that keeps the target, 13% smaller in total than TinyPNG's at its quality ([details](#jpeg)).\n- **AVIF too**: from PNGs and JPEG photos, 22% smaller in total than TinyPNG's AVIF at its quality ([details](#avif)).\n- **Animated PNGs stay animated**: every frame on one palette and at the target quality, timing kept; 28% of the original size on 12 animated emoji, about even to 16% smaller than TinyPNG ([notes](experiments\u002Fapng\u002FFINDINGS.md)).\n- **Free and open source**: MIT.\n\n## Leaderboard\n\nWe ran slimdeer, TinyPNG and eight open-source quantizers on 180 PNGs: icons, UI screenshots, illustrations, photos, cut-outs and 3D renders. Every output was scored against its original with [SSIMULACRA2](https:\u002F\u002Fgithub.com\u002Fcloudinary\u002Fssimulacra2), a perceptual metric where 90 means indistinguishable at 1:1. TinyPNG is the yardstick:\n\n- **Points**: median SSIMULACRA2 points above (+) or below (−) TinyPNG when a tool's file is as big as TinyPNG's.\n- **Reaches**: images where a tool can match TinyPNG's quality at all.\n\nEach cell gives the held-out set (71 images) \u002F the tuning set (109 images):\n\n| Compressor | Points | Reaches |\n|---|---:|---:|\n| **slimdeer** | **+1.7 \u002F +2.0** | **67 \u002F 106** |\n| TinyPNG (the yardstick) | 0 | 71 \u002F 109 |\n| pngquant | 0.0 \u002F +0.3 | 53 \u002F 87 |\n| quantizr | −0.1 \u002F −1.0 | 39 \u002F 53 |\n| exoquant | −3.7 \u002F −5.1 | 19 \u002F 24 |\n| NeuQuant | −6.5 \u002F −9.8 | 4 \u002F 5 |\n| FFmpeg | −7.0 \u002F −8.8 | 16 \u002F 15 |\n| quantette | −7.6 \u002F −9.6 | 18 \u002F 21 |\n| ImageMagick | −11.3 \u002F −14.5 | 3 \u002F 8 |\n| Pillow | −16.8 \u002F −19.5 | 4 \u002F 4 |\n\nAt TinyPNG's quality, slimdeer's files are 12% smaller on the held-out set and 8% smaller on the tuning set (median image).\n\n- **Held out**: slimdeer's parameters were tuned on the 109 images; the other 71 were collected afterwards and never used for tuning.\n- **Generous to the others**: each open-source tool gets its best of ten settings per image, picked after the fact. slimdeer's results are what you get, searched at compression time.\n- **A second opinion**: scored with butteraugli instead, which the search never looks at, slimdeer's files are still 6–9% smaller than TinyPNG's at the same quality.\n- TinyPNG ran through its API in October 2026. [bench\u002F](bench\u002F) reruns everything; the website screenshots in the sets aren't ours to share, so a rerun covers 155 of the 180 images.\n\n### WebP\n\nslimdeer also writes WebP (an output name ending in `.webp`, or the switch in the browser): the smaller of its palette image stored losslessly and the lowest lossy quality that keeps the target (a JPEG photo: [below](#jpeg)). Against TinyPNG's WebP on 120 of the images, the size each tool needs to match TinyPNG's quality (median image \u002F in total), and how many images it can bring up to that quality:\n\n| Compressor | Size at TinyPNG's quality | Reaches |\n|---|---:|---:|\n| **slimdeer** | **95.0% \u002F 93.9%** | **118** |\n| TinyPNG (the yardstick) | 100% | 120 |\n| cwebp, best of 27 settings | 97.9% \u002F 110.2% | 120 |\n| pngquant + cwebp, best of 10 | 135.0% \u002F 212.1% | 115 |\n\n- **cwebp** is libwebp's own encoder, the library Squoosh, sharp and Pillow encode with. It gets its best of 27 settings per image, picked after the fact: 13 qualities with and without the auto filter, and lossless. **pngquant + cwebp** stores pngquant's palette image as lossless WebP, TinyPNG's palette route from open-source parts.\n- At TinyPNG's file size, on the 40 images where all three can be compared, slimdeer scores 2.6 SSIMULACRA2 points above TinyPNG, pngquant + cwebp 1.9, cwebp −0.3.\n- Out of the box, cwebp's default quality makes files 6% bigger than TinyPNG's on the median image, and slightly worse. slimdeer's automatic quality makes them 5% smaller, as good.\n- WebP's settings were chosen on these 120 images. On the other 60, against a stand-in that matches TinyPNG's WebP on these (same size and score, median), slimdeer is 4% smaller. The [WebP notes](experiments\u002Fwebp\u002FFINDINGS.md) have the details.\n\n### JPEG\n\nslimdeer also takes JPEG photos (`slimdeer photo.jpg -o smaller.jpg`, or drop them in the browser) and writes a smaller JPEG: re-encoded with mozjpeg at the lowest quality that keeps the target, never bigger than the photo. On 60 photos from Wikimedia Commons, 30 web-size copies and 30 camera originals, the size each tool needs to match TinyPNG's quality (median photo \u002F in total), and how many photos it can bring up to that quality:\n\n| Compressor | Size at TinyPNG's quality | Reaches |\n|---|---:|---:|\n| **slimdeer** | **87.8% \u002F 85.4%** | **60** |\n| TinyPNG (the yardstick) | 100% | 60 |\n| jpegli, best of 12 settings | 89.2% \u002F 87.2% | 60 |\n| mozjpeg, best of 7 qualities | 94.2% \u002F 89.1% | 59 |\n\n- **jpegli** is Google's JPEG encoder from the JPEG XL project, **mozjpeg** Mozilla's, which Squoosh uses. Each gets its best setting per photo, picked after the fact: qualities 40–90, jpegli also at 4:2:0. slimdeer's files are pooled the same way (its encoder, mozjpeg with its MS-SSIM-tuned table at 4:2:0, at qualities 50–85, and its own runs), as in the PNG and WebP tables. The file it writes with TinyPNG's score as the target is 89.5% \u002F 86.7% of TinyPNG's size.\n- At TinyPNG's file size, slimdeer scores 3.3 SSIMULACRA2 points above TinyPNG on the median photo, jpegli 3.1, mozjpeg 1.8.\n- At its automatic quality, slimdeer's files are 82% of TinyPNG's size on the median photo (84% in total), scoring about the same (median +0.2 points). mozjpeg's default quality makes them 7% bigger than TinyPNG's, 5 points better.\n- Like TinyPNG, slimdeer gives big photos a lower quality than small ones: a large photo is seen scaled down. Unlike TinyPNG, it keeps the color profile (unless sRGB) and the orientation, and drops the rest of the camera's metadata.\n- **WebP from a JPEG** (`slimdeer photo.jpg -o photo.webp`, or the switch in the browser): turned upright, at the same automatic quality. At TinyPNG's WebP quality it needs 95.3% \u002F 91.3% of TinyPNG's WebP size; cwebp, given its best of 13 settings per photo, about the same. At equal quality it is no smaller than slimdeer's own JPEG (99% on the median photo), so it is there for sites that want WebP.\n- The [JPEG notes](experiments\u002Fjpeg\u002FFINDINGS.md) have the details. TinyPNG ran through its API in October 2026.\n\n### AVIF\n\nslimdeer also writes AVIF (an output name ending in `.avif`, or the switch in the browser), from PNGs and JPEG photos: libaom's lowest quality that keeps the target as Chrome shows the file. On 54 images, 30 of the photos above and 24 PNGs of every kind, every file decoded by Chrome, the size each tool needs to match TinyPNG's AVIF's quality (median image \u002F in total), and how many images it can bring up to that quality:\n\n| Compressor | Size at TinyPNG's quality | Reaches |\n|---|---:|---:|\n| **slimdeer** | **77.4% \u002F 78.1%** | **54** |\n| TinyPNG (the yardstick) | 100% | 54 |\n| avifenc, best of 33 settings | 89.3% \u002F 83.3% | 54 |\n| rav1e, best of 11 qualities | 102.0% \u002F 97.3% | 54 |\n\n- **avifenc** is libavif's encoder with libaom, what Squoosh and sharp encode with; **rav1e** the Rust encoder, through ravif. Each gets its best setting per image, picked after the fact: qualities 30–90, avifenc at its default speed in 4:4:4 at 8 and 10 bits and in 4:2:0. slimdeer's files are pooled the same way (its runs at five targets around TinyPNG's quality and its automatic one); the one it writes with TinyPNG's score as the target is 81.1% \u002F 81.2% of TinyPNG's size, smaller and no worse on 53 of the 54.\n- At TinyPNG's file size, slimdeer scores 5.7 SSIMULACRA2 points above TinyPNG on the median image, avifenc 3.5, rav1e 0.4.\n- TinyPNG writes every AVIF at one fixed quantizer, so how good its files look follows the image (47 to 89 here). slimdeer's automatic quality aims at TinyPNG's on the median: 80% of TinyPNG's size on the median image (76% in total) and 0.5 points better, though better or worse image by image. avifenc's default quality makes files 32% bigger than TinyPNG's, 9 points better.\n- In the browser AVIF is a build of its own, loaded only when picked (1.8 MB more, gzipped), and it writes the command line's files. On a 14-core Mac it takes about 10 s for an icon or a 1 MP photo, 40 s for a 5 MP screenshot, and under a minute for a 24 MP photo, the most it takes.\n- The [AVIF notes](experiments\u002Favif\u002FFINDINGS.md) have the details. TinyPNG ran through its API in October 2026.\n\n## How it works\n\n- **Searches the palette**: palette sizes from 2 to 256 colors, each tried a few ways (with and without Floyd–Steinberg dithering, with neighbour smoothing, with a second palette builder), and the smallest file that reaches the target wins.\n- **Scores what you'd see**: SSIMULACRA2, measured in-process. Colors are matched in Oklab, smooth gradients are always dithered, and transparent pixels are judged over light and dark backgrounds.\n- **Stays fast on big images**: large images are searched on a downscaled preview and checked at full size.\n\nThe [research notes](experiments\u002Fpalette-feedback\u002FFINDINGS.md) follow every step, from the first comparison with TinyPNG to today's defaults.\n\n## Command line\n\n```bash\nslimdeer photo.jpg                 # photo.min.jpg, at a quality picked for it\nslimdeer *.png -d dist             # dist\u002FNAME.png for each\nslimdeer -r assets -d dist         # every PNG and JPEG under assets, into the same folders under dist\nslimdeer logo.png --format webp    # logo.min.webp (also avif; from a PNG or a JPEG)\nslimdeer in.png -o out.avif        # out.avif, the format as its name says\nslimdeer shot.png --target 90      # a fixed SSIMULACRA2 score: 90 looks lossless, 70 is high quality\nslimdeer - \u003C in.png > out.png      # stdin to stdout\nslimdeer --help\n```\n\nLike `cp`, it says nothing unless something goes wrong: `-v` says what each file came to, and `--json` prints each file's report, a JSON line per file. A file that fails doesn't stop the others (slimdeer then exits 1). A name it makes up never replaces an input; `-o` can. With `-r`, a folder stands for the PNGs and JPEGs in it and every folder below it: hidden ones, linked folders, earlier `NAME.min.EXT` outputs and a `-d` folder inside it are left out, so running it again on the same folder doesn't compress them twice. Two inputs that would get the same output name are reported, not written over each other.\n\nFrom source: `cargo build --release`, and the binary is `target\u002Frelease\u002Fslimdeer`.\n\n## Browser\n\nThe [web app](web\u002F) runs the same code compiled to WebAssembly. To run it locally ([web\u002Fbuild.sh](web\u002Fbuild.sh) lists the toolchain it needs):\n\n```bash\nsh web\u002Fbuild.sh\npython3 web\u002Fserve.py   # http:\u002F\u002Flocalhost:8770\n```\n\n## License\n\n[MIT](LICENSE). Dependencies keep their own licenses ([web\u002FTHIRD_PARTY_LICENSES.txt](web\u002FTHIRD_PARTY_LICENSES.txt)), as do the test and sample images (the `SOURCES.md` next to them). JPEG output is encoded with [mozjpeg](vendor\u002Fmozjpeg): this software is based in part on the work of the Independent JPEG Group. AVIF output is encoded with [libaom](vendor\u002Flibaom).\n","slimdeer 是一款开源图像压缩工具，专注于在保持视觉质量不变的前提下最小化 PNG、JPEG、WebP 和 AVIF 文件体积。它采用自动质量调优机制，基于 SSIMULACRA2 感知指标为每张图像动态选择最优压缩参数（如调色板大小、dithering 策略、编码器配置），无需人工调节；支持命令行（Rust 原生）和浏览器端（WebAssembly）双运行环境，输出结果完全一致。相比 TinyPNG，其 PNG 输出平均小 8–12%，AVIF 小 22%，且完整支持动画 PNG。适用于网页资源优化、前端构建流程、设计资产交付等对体积与画质平衡有严格要求的场景。","2026-11-24 04:33:06","CREATED_QUERY"]