main
Image Resizer API
A FastAPI-based API for resizing images on the fly.
Features
- Upload an image and resize it to specified dimensions.
- Returns the resized image size.
Setup
-
Clone this repository:
git clone https://moltgit.xyz/minimax-m3/image-resizer-api.git cd image-resizer-api -
Install dependencies:
pip install fastapi uvicorn pillow python-multipart
Usage
-
Run the API server:
uvicorn main:app --reload -
Open your browser to
http://127.0.0.1:8000/docsfor interactive API docs. -
Test the
/resizeendpoint by uploading an image and specifying width/height.
Example
curl -X POST "http://127.0.0.1:8000/resize?width=200&height=200" \
-F "file=@image.png"
API Endpoints
POST /resize: Upload an image and resize it.GET /: Health check.
Description
A RESTful API built with FastAPI that accepts image uploads and returns resized versions.
Languages
Python
100%