# Image Format Converter

## /es5-es6

This endpoint accepts a GET request with query parameters including the `imageUrl`, `format`, and optionally `quality`. It fetches the image from the provided URL, converts it to the specified format with the given quality, and sends the converted image as the response. If any required parameters are missing or invalid, or there is an error during the conversion process, it returns a 400 or 500 error with a corresponding message.

### Query Parameters

* `imageUrl`: The URL of the image to be converted. (Required)
* `format`: The target format to which the image should be converted (`jpeg`, `jpg`, `png`, or `webp`). (Required)
* `quality`: The quality level of the converted image. It should be an integer value between 1 and 100. The default quality is 80 if not specified.

### Example

```http
GET /es5-es6?imageUrl=http://example.com/image.jpg&format=webp&quality=80
```

### Response

* If the conversion is successful, the API returns the converted image with the appropriate content type set.
* If there are any errors during the conversion process or fetching the image, the API returns an error response with status code `500` and a JSON object containing the error message.

### Notes

* Supported input formats: JPEG, PNG, and WebP.
* Supported output formats: JPEG, PNG, and WebP.
* The quality parameter is only applicable for formats like JPEG and WebP. It affects the compression level and file size of the converted image.


---

# 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.ziomark.xyz/get-endpoints/image-format-converter.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.
