For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
GuidesIntegrationsAPI ReferencesRelease notes
GuidesIntegrationsAPI ReferencesRelease notes
  • Introduction
    • Overview
    • Quick Start
    • Projects
    • Billing
  • Uploading
    • Overview
      • Overview
      • Installation
        • Configuration
        • Options
        • Image shrink
        • Upload sources
      • HTML forms
      • Built-in image editor
      • Security settings
      • Breaking changes
    • Uploading files with API
    • File analysis on upload
  • Optimization
    • Overview
  • Transformations
  • Delivery
    • Overview
    • On-the-fly operations
    • CDN settings
    • Proxy
  • Security
    • Overview
    • Validation and moderation
    • Signed uploads
    • Signed URLs
    • Unsafe content moderation
    • Malware protection
    • HIPAA workflows
  • Storage
    • Uploadcare storage
    • Cloudflare R2
    • Google Cloud Storage
    • Azure Blob Storage
  • File management
    • Overview
    • Managing files
    • File groups
    • Webhooks
    • Arbitrary file metadata
  • CLI
    • Overview
    • Configuration
  • Migration
    • Migration to Uploadcare
    • Migration from Filestack
Dashboard
LogoLogo
On this page
  • Automatically resize images before upload
  • Specs and limits
UploadingFile UploaderConfiguration

Image shrink before upload

Was this page helpful?
Previous

Upload sources for File Uploader

Next
Built with

Automatically resize images before upload

File Uploader lets you setup behavior that will shrink hi-res images before uploading.

Benefits of automatic image resize on upload:

  • Users don’t need to downscale images on their devices to meet the uploading requirements.
  • Optimized storage.
  • Faster uploading.

Use the image-shrink option to apply client-side image resize with values like:

  • 800x600, shrinks images to 0.48 megapixels with the default JPEG quality of 80% (default, when not set).
  • 1600x1600 95%, shrinks images to 2.5 megapixels with the JPEG quality set to 95%.

Specs and limits

The output resolution limit for image-shrink is 268 MP (e.g., 16384x16384). It conforms to the maximum resolution that WebKit desktop browsers support. We recommend not to use values greater than 16.7 MP (4096x4096), because it’s a current limit for iOS devices.

Note: Image shrink is built on top of HTML canvas, so it can only handle formats that the browser natively supports. We recommend using the “preview” operation on image URLs to ensure that high-resolution images are delivered at a smaller size, and that images that have been resized before uploading remain intact.

Uploaded images won’t be shrunk in the following cases:

  • When a client browser doesn’t support a specified output resolution.
  • For images uploaded from social media and URLs
  • If the original resolution is less than 2x larger than the target resolution. For example, it won’t shrink a 2560x1560px (4 MP) image to 1600x1600px (2.5 MP). It will work if you had a 2448x3264px (8 MP) input image. This limitation preserves an optimal image quality and file size balance.
  • If the image color mode is CMYK.

The output format will be JPEG by default unless your input image has an alpha channel (transparency). In this case, PNG will be used instead. Grayscale images will be converted to RGB.

EXIF and ICC profile info is copied as-is and includes an original image orientation, camera model, geolocation, and other settings of an original image.