> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwedai.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Image engine

> QWED's Image Engine verifies image claims using deterministic metadata extraction first, with advisory-only VLM fallback for semantic claims.

The Image Engine verifies claims about images using **deterministic methods first**, with VLM fallback only for complex semantic claims.

## Features

* **Metadata extraction** — dimensions and format (PNG, JPEG, GIF, WebP)
* **Size verification** — exact dimension comparison from metadata
* **Claim classification** — routes claims to the appropriate verifier
* **Advisory VLM cross-check** — optional model fallback for semantic claims

## Usage

```python theme={null}
from qwed_sdk import QWEDClient

client = QWEDClient(api_key="qwed_...")

# Verify claim
result = client.verify_image(
    image_path="chart.png",
    claim="The image is 800x600 pixels"
)

print(result.status)      # "VERIFIED" (deterministic metadata proof)
print(result.is_verified) # True
print(result.result["developer_fields"]["analysis"]["metadata"])  # {"width": 800, "height": 600, "format": "png"}
```

## Claim types

| Claim Type | Method | Deterministic? |
| - | - | - |
| Size/Dimensions | Metadata parsing | ✅ 100% |
| Format | Header detection | ✅ 100% |
| Color | Pixel sampling | ⚠️ Partial |
| Text | OCR required | ❌ VLM |
| Semantic | Understanding | ❌ VLM |

## Result contract

The Image Engine returns a [`DiagnosticResult`](/advanced/diagnostics) whose status depends on which path handled the claim:

| Path | `DiagnosticResult.status` | Notes |
| - | - | - |
| Deterministic evidence supports the claim | `VERIFIED` | Emits a `proof_ref` bound to pixel or metadata evidence. |
| Deterministic evidence refutes the claim | `BLOCKED` | Fail-closed refutation. |
| VLM cross-check only | `UNVERIFIABLE` | VLM results are recorded in `advisory_checks`; the engine never emits `VERIFIED` from a VLM alone. |

This mirrors the [3-tier engine classification](/engines/overview): a VLM signal is advisory and cannot promote a claim to `VERIFIED`.

## VLM cross-check (advisory)

Semantic claims (color, text, visual understanding) cannot be proven deterministically. The core `ImageVerifier` supports a VLM fallback for these claims when instantiated with `use_vlm_fallback=True`; the VLM output is recorded in `advisory_checks` and does not change the diagnostic status. The public `/verify/image` endpoint runs with `use_vlm_fallback=False`, so via the SDK a semantic claim resolves to `UNVERIFIABLE` with the VLM path listed as advisory-only:

```python theme={null}
result = client.verify_image(
    image_path="photo.png",
    claim="The person is smiling"
)

print(result.status)      # "UNVERIFIABLE" (deterministic path cannot verify)
print(result.result["developer_fields"].get("advisory_checks", []))  # [] for SDK/API path
```

## Supported providers for image verification

The Image Engine supports multimodal verification through any provider that accepts image inputs. When you set `ACTIVE_PROVIDER=gemini`, QWED uses Google Gemini's native multimodal capabilities for semantic image claims. Supported image formats are JPEG, PNG, and WebP.

```bash theme={null}
export ACTIVE_PROVIDER=gemini
export GOOGLE_API_KEY=your-google-api-key
```

See [LLM configuration](/getting-started/llm-configuration#google-gemini) for full setup instructions.


## Related topics

- [Verification engine tiers: Proof, Policy, Advisory](/engines/overview.md)
- [QWED Protocol: deterministic verification for LLMs](/whitepaper.md)
- [Changelog](/changelog.md)
- [QWED protocol specification](/specs/qwed-spec.md)
- [QWED architecture: translation, verification, guards](/architecture.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.