|
|
4 months ago | |
|---|---|---|
| .build | 4 months ago | |
| JXL Optim.app/Contents | 4 months ago | |
| Sources/JXLOptim | 4 months ago | |
| .gitignore | 4 months ago | |
| 5a899759gy1fcqyix9wkvj22so3klu0x.jpg | 4 months ago | |
| AppIcon.icns | 4 months ago | |
| Package.swift | 4 months ago | |
| README.md | 4 months ago | |
| bundle.sh | 4 months ago | |
An ImageOptim-style drag-and-drop optimizer that re-encodes JPG / PNG / GIF into
JPEG XL (.jxl). Native SwiftUI, macOS 12+. Wraps the cjxl encoder from
libjxl.
brew install jpeg-xl # provides cjxl / djxl
The app looks for cjxl in /usr/local/bin, /opt/homebrew/bin, /usr/bin.
If it isn't found you'll see a red banner with the install hint.
swift run # dev: launches the window
./bundle.sh # builds "JXL Optim.app" (release, double-clickable)
open "JXL Optim.app"
Drop images onto the window. Each is converted to a sibling .jxl; the row shows
before → after and the percentage saved. A running total sits at the bottom.
Controls:
cjxl -d 0). PNG/GIF stay perfect; JPEG is
transcoded losslessly (decode-back gives the original).d0.5–d3.0 (lower = better). d1 ≈ visually lossless.cjxl in.png out.jxl -e <effort> --num_threads 0 [-d 0 | -d <distance>]
./bundle.sh 默认 ad-hoc 签名,本机可直接打开。对外分发需 Apple Developer ID:
SIGN_ID="Developer ID Application: NAME (TEAMID)" ./bundle.sh
ditto -c -k --keepParent "JXL Optim.app" JXLOptim.zip
xcrun notarytool submit JXLOptim.zip --apple-id you@me.com --team-id TEAMID --wait
xcrun stapler staple "JXL Optim.app"
| 输出 | CLI | 安装 |
|---|---|---|
| JPEG XL | cjxl | brew install jpeg-xl |
| AVIF | avifenc | brew install libavif |
| WebP | cwebp | brew install webp |
讲解文章在 Niamos vault: wiki/projects/自己写一个 JPEG XL 压缩器.md。