File

File Manipulation

Trelae lets you transform uploaded files by queuing one or more operations—such as resizing, cropping, tinting, adding text—and then applying them all at once with .save().

Currently, only image files (image/*) are supported for manipulation. Support for PDFs and additional file types is coming soon.


Supported Operations (current image support)

  • resize / crop
  • compress / convert / rotate / flip
  • border / background
  • grayscale, blur, sharpen, tint, adjust
  • threshold, trim
  • composite (overlay another file/image)
  • addText
  • removeBackground

How It Works

  1. Create a file handle: const file = trelae.file('FILE_ID')
  2. Chain operations: file.resize({ width: 400 }).rotate(90)...
  3. Apply everything with .save()

Next Steps

See the full guide with code examples for every operation:

Image Manipulation Guide →