# Card condition from photos

Send a photo of a card's front, and ideally its back. You get measured centering and edge whitening, the damage a vision model can see, and the **grade range** that evidence allows, with what the photos can't show. The same feature is available as the GraphQL field `assessCondition`, the MCP tool `assess_condition` and the CLI command `raritydb condition`.

```graphql
query($front: String!, $back: String) {
  assessCondition(front: $front, back: $back) {
    gradeRange { low high } confidence limitingFactors
    centeringLimits { grader grade note }
    front { centering { leftRight { display uncertainty } topBottom { display uncertainty } bordersMm }
            wear { location kind whitening severity } cardShortEdgePx glareFraction }
    back { centering { leftRight { display } topBottom { display } } wear { location severity } }
    defects { kind side location severity confidence }
    cannotAssess disclaimer
  }
}
```

```bash
raritydb condition front.jpg --back back.jpg
```

Images are base64, a data URL or an `https://` URL (JPEG, PNG or WebP, at most 10 MB). Each call counts as one request.

**This is an estimate, not an official grade.** raritydb is not affiliated with PSA, BGS or CGC; their names only describe the scale.

## Taking the photos

- Take the card out of its toploader or slab. A penny sleeve adds glare and hides edges.
- Lay it flat on a plain background that contrasts with the border (dark for yellow or silver borders).
- Use soft, even light from above, with no glare stripe across the card.
- Fill most of the frame. The card must be **at least 1000 px wide** in the photo; 1500 px or more gives tighter centering.
- Photograph the back too. Without it, back centering, edges and surface aren't assessed, and the range is wider.

## What's measured

- **Centering:** the card's cut edge and the inner edge of its border are found along 40 lines per side. Border widths give left/right and top/bottom ratios, e.g. `57/43 ±1.4`. The ± comes from how consistent those lines are and the photo's resolution.
  - Full-art, borderless and textured-border cards have no clean border to measure. Those axes come back null and are listed in `cannotAssess`.
  - **Consistency check:** a Pokémon card's border is the same width all round, and a miscut only moves it from one side to the other. If left+right and top+bottom disagree by more than 25%, the inner edge was found inside the design (for example, a pale name bar next to the border). That axis is reported as not measurable rather than guessed.
- **Centering limits:** the best grade each grader's **published** centering limits allow for the worse axis.
  - **PSA:** 10 needs 55/45 front and 75/25 back; 9 needs 60/40; 7, 75/25.
  - **CGC:** Pristine 10 needs 50/50; Gem Mint 10, 55/45 front and 75/25 back; 9, 60/40 front and 90/10 back; 8, 65/35.
  - **BGS:** publishes only the Pristine 10 limit (50/50 front, 55/45 back).
  - **Grades without a published number** are ruled out only by the next looser published limit.
- **Whitening:** for each edge (a 1.5 mm band) and corner (up to a 4 mm square, kept within the border), the share of worn-white pixels against a coloured border. Glare blobs and anything matching the table outside the card don't count. On a white table, or with a white or silver border, whitening can't be told apart and is reported `not_measurable`, so use a dark background. Severity is `none`, `light` (under 2%), `moderate` (under 6%) or `heavy`. White or silver borders are `not_measurable`.

## What the vision model reports

Creases, dents, indentations, scratches, print lines, stains, writing, edge chips and corner wear, each with a side, location, severity and confidence. Only defects at least 50% likely are returned. It also lists what the photos can't show, e.g. "fine scratches need raking light".

## How the range is set

- **Each factor caps the grade:**
  - **Centering:** PSA's published limits.
  - **Measured whitening:** light 9, moderate 8, heavy 6.
  - **Defects:** for example, a minor crease caps at 6 and a dent at 7.
- **`high`:** the best case the evidence allows. Centering is read at the favourable end of its ±, and only defects at least 80% likely count.
- **`low`:** the worst case it doesn't rule out. Centering is read at the unfavourable end, defects at least 50% likely count, and it goes lower for what couldn't be seen:
  - one grade for a missing back
  - one for unseen surface or listed limits
  - one for unmeasurable centering
  - half a grade for heavy glare
- **`confidence`:** `high` when the range spans one grade or less, `medium` for two, `low` beyond that. `limitingFactors` lists what holds the grade down.

## Limits

- Photos can't show fine surface scratches, slight dents without raking light, or anything hidden by glare or a sleeve. Graders also judge eye appeal.
- There's no public set of graded-card photos to calibrate against, so treat the range as a pre-screen before paying for grading, not a promise.
