# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yetanotherapi.com/document-parser/png-and-jpg-parser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
