Image Resizer/Optimizer API

Automation Tribe Logo

This API endpoint was made by Automation Tribe.
Join our community at https://www.skool.com/automation-tribe.

This API resizes and optimizes images provided via URL or direct upload. Input is via form-data (multipart/form-data).

Logging: On errors, a log file (e.g., image_resize_timestamp.log) will be created in the 'logs' subfolder of temp_image_files.

Server Status

API Usage

Endpoint

https://n8achraf.com/image-resizer.php

HTTP Method

POST

Content Type

multipart/form-data

Form Data Parameters:

You must provide either image_file or image_url.

Success Response

On success, the API returns the processed image directly with the appropriate Content-Type header (e.g., image/jpeg) and a Content-Disposition: inline; filename="your_filename.jpg" header. You can display this image directly or save it.

Error Response (JSON)

{
    "error": "Descriptive error message."
}

How to Use (cURL Example)

Using image_url with custom filename:

curl -X POST 'https://n8achraf.com/image-resizer.php' \
  -F "image_url=https://www.php.net/images/logos/new-php-logo.png" \
  -F "width=300" \
  -F "format=jpeg" \
  -F "quality=80" \
  -F "output_filename=php_logo_resized" \
  -o php_logo_resized.jpg

Uploading a local file (replace path/to/your/image.png):

curl -X POST 'https://n8achraf.com/image-resizer.php' \
  -F "image_file=@path/to/your/image.png" \
  -F "height=200" \
  -F "format=webp" \
  -F "output_filename=my_uploaded_image" \
  -o my_uploaded_image.webp

Important Notes