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

# Upload a PNG or JPEG Image for Visual Attention Analysis

> Upload any PNG or JPEG image to EyeQuant as a Base64-encoded string to get full control over exactly which design or asset is analyzed.

When you have a design mockup, an exported screenshot, or any other PNG or JPEG asset you want to evaluate, you can upload it directly to EyeQuant rather than relying on a live URL. This gives you complete control over exactly what is analyzed — the image is encoded as a Base64 string and sent in the request body alongside the rest of your analysis configuration.

## Encoding your image

Before submitting, you need to convert your image file into a Base64 string. Any standard Base64 encoder will work.

<Tip>
  On Linux and macOS, you already have the `base64` command-line utility available. Run the following to encode an image and write the result to a file:

  ```bash theme={null}
  base64 -i /path/to/image.png > image.png.base64
  ```

  You can then copy the contents of `image.png.base64` into the `content` field of your request.
</Tip>

<Steps>
  <Step title="Encode your image in Base64">
    Convert your PNG or JPEG file to a Base64 string using the tool or library of your choice. The full encoded string — without any line breaks — becomes the value of the `content` field in your request body.
  </Step>

  <Step title="POST to /v2/analyses">
    Send a `POST` request to `/v2/analyses` with an input `type` of `image`. Paste your Base64-encoded image as the `content` value, and set `medium` to reflect the context in which the design will be viewed. Replace `$apikey` with your API credentials.

    ```bash theme={null}
    curl \
      -X POST \
      -H "Authorization: Bearer $apikey" \
      -H "Content-Type: application/json" \
      -d '{
            "input": {
              "type": "image",
              "content": "iVBORw0KGgoAAAANSUhE....FTkSuQmCC",
              "medium": "desktopWeb",
              "title": "Example"
            }
          }' \
      https://api.eyequant.com/v2/analyses
    ```

    The API returns HTTP `201 Created` with the ID and `location` of your new analysis, exactly as it does for URL-based analyses.
  </Step>

  <Step title="Retrieve your results">
    Poll the `location` URL returned in the previous step with a `GET` request until the `status` field changes from `pending` to `success`. Once the analysis completes, the response body contains output URLs for each requested prediction — by default, an attention heatmap at `outputs.attention.attentionMap`.

    For a detailed walkthrough of the polling flow, refer to the [Analyze URLs guide](/guides/analyzing-urls).
  </Step>
</Steps>

For information on supported file formats, maximum image dimensions, and file size limits, see the [Input Formats reference](/concepts/input-formats).
