model-selection.md
Language Markdown3.8 KB64 lines
# Model selection referenceHow the prep engine routes an image to a Topaz Gigapixel model, what each feature means, andwhen to override the automatic call by eye. Read this when a recommendation looks wrong or theuser asks why a model was chosen.## Features measured (`analyze()`)| Feature | Meaning | Reads as ||---|---|---|| `uniq` | raw unique opaque colors | low (<200) = clean indexed/vector logo || `uniqq` | colors after quantizing to 32 levels/channel | collapses JPEG/AA near-duplicates; reflects the *real* palette || `flat` | uniq ÷ opaque-pixel count | high (>0.15) on a small image = jaggy AA = genuinely low-res || `edge` | mean absolute luminance gradient | high = lots of edges (text, linework, detail) || `hf` | high-frequency energy (image minus slight blur) | low on a *large* image = soft = possible false resolution || `blk` | step magnitude on the 8px DCT grid vs everywhere | >1.1 hints at JPEG block artifacts || `transp` / `semi` | fraction not fully opaque / soft-edged | drives alpha split + defringe |## Routing table (`classify()`)Rules are evaluated in order; the first match wins.| # | Condition | Category | Model (alt) | Key settings ||---|---|---|---|---|| 1 | `px < 90k` AND `flat > 0.15` | Low-res / degraded | **Wonder 3** (Low Resolution 2) | generative; no Python sharpen || 2 | JPEG, `edge > 0.03` | Detailed line art (JPEG) | **Art & CG** (Standard) | Fix Compression On || 3 | JPEG, else | Flat logo (JPEG) | **Art & CG** (Standard) | Fix Compression On || 4 | `uniq < 200` | Flat vector logo | **Text & Shapes** (Art & CG) | Fix Compression Off || 5 | `px > 300k` AND `uniqq > 700` | Detailed illustration | **Standard** (Art & CG) | true-to-input || 6 | else | Gradient / rendered logo | **Art & CG** (Standard) | keeps gradients + clean edges |Independent of category:- **Fix Compression**: On (Medium) for any JPEG source, Off otherwise.- **Denoise / Sharpen**: Off by default. Denoise Low only if grain survives Fix Compression.Never sharpen in the pre-pass; the model owns edges.- **Face Recovery**: Off. Skull marks and mascot figures are stylized, not real faces, andFace Recovery will distort them.- **Pre-downscaling**: flagged Low-Medium when `min_side ≥ 600` and `hf < 0.012` (large butsoft). Recommend Topaz's own toggle, or re-run with `--predownscale` to bake it in.- **Color space**: preserve input; export Adobe RGB if the file is going into CMYK prepress.Do not rely on Topaz's single SWOP CMYK profile for dye-sub/large-format, convert in prepress.## When to override by eyeThe classifier routes from statistics and can't see *meaning*. Override when the image tellsyou something the numbers don't:- **Flat vector defaulted to Text & Shapes, but it's emblem/illustration-dominant** (a badge,a mascot, a crest with little lettering): switch to **Art & CG**. Text & Shapes is for piecesthat are mostly type and geometry.- **A "gradient/rendered" logo is actually a photograph or photoreal render**: consider**Standard** or **High Fidelity 3** instead of Art & CG.- **A flat JPEG is extremely soft and large** (text edges mushy): pre-downscale first(`--predownscale`) so Fix Compression + Art & CG have concentrated pixels to work from.- **Degraded route (Wonder 3) over-invents detail** on a recognizable mark: fall back to thealternate (Low Resolution 2), which reconstructs less aggressively and stays closer to source.## Print sizing logicThe report's "Print reach" lines come from the source dimensions × Topaz's 6x ceiling, dividedby viewing-distance PPI: 150 PPI for close viewing (≤6 ft), 100 PPI standing (~10 ft), 60 PPIdistant (≥20 ft). These follow Topaz's own viewing-distance guidance (closer needs more PPI).Use them to tell a client whether a small source can actually reach the banner size they want,before committing to the upscale.