Sign inSign up

ogulcanaydogan/image-resizer

By ogulcanaydogan

•Updated 7 months ago

On-the-fly image resize, crop, convert and optimization API

Image
0

904

ogulcanaydogan/image-resizer repository overview

⁠Image Resizer

On-the-fly image resize, crop, convert, and optimization API.

⁠Quick Start

docker run -p 8080:8080 ogulcanaydogan/image-resizer

# Resize an image
curl -X POST http://localhost:8080/api/resize \
  -F "[email protected]" \
  -F "width=800" \
  -F "format=webp" \
  -o resized.webp

⁠API Endpoints

⁠POST /api/resize

Resize and transform an image.

ParameterDescriptionDefault
widthTarget width (px)-
heightTarget height (px)-
fitResize mode: contain, cover, fillcontain
qualityOutput quality (1-100)85
formatOutput format (jpeg/png/webp/gif)original
cropCrop region: x,y,w,h-
rotateRotation degrees-
grayscaleConvert to grayscalefalse
flipFlip: horizontal, vertical-
⁠POST /api/convert

Convert image format.

⁠POST /api/info

Get image metadata (dimensions, format, mode).

⁠Environment Variables

VariableDescriptionDefault
PORTServer port8080
MAX_UPLOAD_MBMax upload size (MB)50
DEFAULT_QUALITYDefault output quality85
MAX_DIMENSIONMax output dimension (px)4096

⁠Docker Compose Example

services:
  resizer:
    image: ogulcanaydogan/image-resizer
    ports:
      - "8080:8080"
    environment:
      - DEFAULT_QUALITY=90
      - MAX_UPLOAD_MB=100

⁠License

MIT

Tag summary

Content type

Image

Digest

sha256:b1c05810d…

Size

53.9 MB

Last updated

7 months ago

docker pull ogulcanaydogan/image-resizer