> For the complete documentation index, see [llms.txt](https://docs.yetanotherapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yetanotherapi.com/document-parser/png-and-jpg-parser.md).

# PNG & JPG Parser

## Image Processing Guide

Document Parser API supports text extraction from various image formats using OCR technology.

### Endpoint

`POST /documents/parse`

### Supported Image Types

1. JPEG/JPG

```json
{
    "url": "string",
    "type": "jpg",          // or "jpeg"
    "output": "plain|markdown"
}
```

2. PNG

```json
{
    "url": "string",
    "type": "png",
    "output": "plain|markdown"
}
```

3. TIFF/TIF

```json
{
    "url": "string",
    "type": "tiff",         // or "tif"
    "output": "plain|markdown"
}
```

4. HEIC

```json
{
    "url": "string",
    "type": "heic",
    "output": "plain|markdown"
}
```

### Image Processing Features

* Text extraction using OCR
* Multi-page support for TIFF
* Various image resolutions supported
* Color, grayscale, and black/white images
* Maximum file size: 50MB

### Example Request

```bash
curl --location 'https://api.yetanotherapi.com/documents/parse' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "url": "https://example.com/scan.jpg",
    "type": "jpg",
    "output": "markdown"
}'
```

### Response Format

For single-page images:

```json
{
    "requestId": "string",
    "status": "COMPLETED",
    "data": "Extracted text content"
}
```

For multi-page TIFF:

```json
{
    "requestId": "string",
    "status": "COMPLETED",
    "data": "Page 1 content\n\n=== Page Break ===\n\nPage 2 content"
}
```

### Image-Specific Limitations

1. Image quality affects OCR accuracy
2. Minimum resolution required: 300 DPI
3. Handwritten text may not be accurately recognized
4. Complex backgrounds can affect accuracy
5. Text must be properly oriented
