---
title: "File Type & Quality | ScreenshotAPI Docs"
slug: "/docs/renderScreenshot/file-type-and-quality"
description: "Learn how to control output file types and image quality in ScreenshotAPI. Configure formats such as JPEG, PNG, WebP, and PDF for different use cases."
---

# File Type & Quality

ScreenshotAPI allows you to control the output format of your screenshots based on your requirements. You can generate images in multiple formats such as PNG, JPEG, WebP, and PDF. Each format serves different use cases for example, PNG for high-quality lossless images, JPEG for smaller file sizes, WebP for optimized web performance, and PDF for document-style exports.

The quality parameter lets you adjust compression levels for formats like JPEG, while the retina option (2x or higher) increases pixel density for sharper, high-resolution screenshots. This is especially useful for modern displays and when high visual clarity is required.

```js

const axios = require("axios");

let config = {
	method: "get",
	maxBodyLength: Infinity,
	url: "https://shot.screenshotapi.net/v3/screenshot?token=TOKEN&url=https%3A%2F%2Fwww.apple.com%2F&file_type=jpg&image_quality=100&[OPTIONS]",
	headers: { }
};

axios.request(config).then((response) => {
	console.log(JSON.stringify(response.data));
}.catch((error) => {
	console.log(error);
});
```

```php

<?php
	$client = new http.Client;
	$request = new http.Client.Request;
	$request->setRequestUrl("https://shot.screenshotapi.net/v3/screenshot?token=TOKEN&url=https%3A%2F%2Fwww.apple.com%2F&file_type=jpg&image_quality=100&[OPTIONS]");
	$request->setRequestMethod("GET");
	$request->setOptions(array());

	$client->enqueue($request)->send();
	$response = $client->getResponse();
	echo $response->getBody();
?>
```

```go

package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {
	url := "https://shot.screenshotapi.net/v3/screenshot?token=TOKEN&url=https%3A%2F%2Fwww.apple.com%2F&file_type=jpg&image_quality=100&[OPTIONS]"
	method := "GET"

	client := &http.Client { }
	req, err := http.NewRequest(method, url, nil)

	if err != nil {
		fmt.Println(err)
		return
	}

	res, err := client.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}

	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)
	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}
```

```java

OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder().url("https://shot.screenshotapi.net/v3/screenshot?token=TOKEN&url=https%3A%2F%2Fwww.apple.com%2F&file_type=jpg&image_quality=100&[OPTIONS]"
	.method("GET", body)
	.build();
Response response = client.newCall(request)
	.execute();
```

```py

import requests

url = "https://shot.screenshotapi.net/v3/screenshot?token=TOKEN&url=https%3A%2F%2Fwww.apple.com%2F&file_type=jpg&image_quality=100&[OPTIONS]"
payload = {}
headers = {}

response = requests.request("GET", url, headers, data=payload)
print(response.text)
```

```ruby

require "uri"
require "net/http"

url = URI("https://shot.screenshotapi.net/v3/screenshot?token=TOKEN&url=https%3A%2F%2Fwww.apple.com%2F&file_type=jpg&image_quality=100&[OPTIONS]")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body
```

## File Type

**Parameter Name :** `file_type`

This parameter defines the output format of the generated screenshot. It allows you to control how the captured webpage is delivered based on your use case, such as image optimization, documentation, or reporting needs.

It supports multiple formats, each designed for different performance and quality requirements.

**Options**

*   **PNG:** A lossless image format that preserves full quality and supports transparency. Ideal for high-resolution screenshots, UI captures, and design accuracy.
    
*   **JPG:** A compressed image format optimized for smaller file sizes. Best suited for general-purpose screenshots where slight quality loss is acceptable.
    
*   **WebP:** A modern image format that offers superior compression while maintaining high visual quality. It supports both lossy and lossless modes, making it efficient for web performance and storage optimization.
    
*   **PDF:** A document-based output format used for generating printable or shareable screenshot reports. Suitable for multi-page captures, documentation, and formal exports.
    

**When to use**

*   Use `PNG` when image quality and clarity are the top priority, especially for UI/UX reviews or detailed visual inspection.
    
*   Use `JPG` when file size optimization is more important than perfect visual fidelity.
    
*   Use `WebP` when you need a balance between quality and performance, especially for web applications.
    
*   Use `PDF` when generating structured documents, reports, or multi-page website captures for sharing or archiving.
    

**Default value:** `PNG`.

## Retina

**Parameter Name :** `retina`

This parameter controls whether the screenshot or render is generated in high pixel density (2x resolution). When enabled, the system captures the page using Retina-quality rendering, resulting in a much sharper and more detailed image compared to standard resolution.

This is especially useful for modern high-DPI displays where standard screenshots may appear slightly blurry or less crisp. Retina mode ensures that text, images, and UI elements are rendered with enhanced clarity and precision.

However, enabling this option increases the overall image size and may slightly impact processing time due to the higher resolution output.

**Options**

*   **true:** Captures the screenshot in Retina (2x) resolution for high-definition, sharper image quality.
    
*   **false:** Captures a standard-resolution screenshot with faster processing and smaller file size.
    

**When to use**

*   Use `true` when image quality is a priority, such as client presentations, design reviews, UI/UX audits, or any scenario where clarity and sharpness matter.
    
*   Use `false` when performance, speed, or smaller file sizes are more important than ultra-high image quality.
    

**Default value:** `false`.

## Image Quality

**Parameter Name :** `image_quality`

This parameter controls the compression level of the output image when using JPG or JPEG formats. It allows you to balance between image clarity and file size depending on your use case.

This setting works on a scale from `0 to 100`, where lower values produce smaller files with higher compression, and higher values preserve more detail with less compression.

**Options**

Value range: 0 – 100

*   **0:** Lowest quality with maximum compression and smallest file size
    
*   **100:** Highest quality with minimal compression and maximum clarity
    

**When to use**

*   Use lower values when optimizing for performance, faster loading, or reduced storage usage, such as bulk screenshots or thumbnails.
    
*   Use higher values when visual clarity is important, such as client reports, UI reviews, or high-resolution presentations where detail matters.
    

**Default value:** `80`.

_`Note:` This parameter only applies to `JPG / JPEG` file types. It does not affect PNG, WebP, or PDF outputs._

## Omit Background

**Parameter Name :** `omit_background`

This parameter controls whether the background of a webpage should be removed during screenshot rendering. When enabled, it attempts to remove simple white or solid backgrounds and replaces them with transparency, creating a clean cut-out effect.

This feature is particularly useful for design workflows where screenshots need to be overlaid on other visuals or used in presentations without a fixed background.

**Options**

*   **true:** Removes the background (if it is a simple white or plain background) and renders the screenshot with a transparent background. This works only when the output format is set to `PNG`.
    
*   **false:** Keeps the original webpage background as it is during rendering.
    

**When to use**

*   Use `true` when you need transparent screenshots for UI mockups, design compositions, or layered visuals where the background should not interfere.
    
*   Use `false` when you want an exact replica of the webpage, including its original background styling and layout.
    

**Default value:** `false`.
