Fit files under an upload limit
fit_fileCompress PDFs or images to fit an upload limit, or a form's size and pixel rules, and save the result beside the original with .fit added.
Instructions
Compress a PDF or image (JPEG, PNG, WebP, TIFF, BMP, or an iPhone HEIC photo, which comes back as a JPEG) on this computer so it fits an upload limit, keeping as much quality as the limit allows, and save the result next to the original as ".fit.". Give path for one file or paths for up to 10 that share the same limit. Give either limit (like "200KB" or "1.5MB"; KB and MB are 1000-based, so the file passes a check done either way) or form (a form preset from list_forms, like "ibps-signature" or "us-visa-photo-ds160", which sets the limit, minimum size and exact pixels that form requires). Every file keeps its format unless jpeg_ok is true. Files up to 50 MB are uploaded to fitfilesize.com over HTTPS, compressed there, and deleted from the server as soon as each result is saved. Free, no account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | When width and height change the shape: "crop" to fill (default) or "pad" with white. | |
| form | No | A form preset id or name from list_forms, like "ibps-photo". Use this or `limit`. | |
| path | No | Full path to the file on this computer ("~/" is allowed). Use this or `paths`. | |
| limit | No | Upload limit, like "200KB", "50 KB" or "1.5MB". Use this or `form`. | |
| paths | No | Full paths to several files that share the same limit, up to 10. Use this or `path`. | |
| width | No | Exact width in pixels (images only). | |
| height | No | Exact height in pixels (images only). | |
| output | No | Where to save the result, with `path` only. Defaults to "<name>.fit.<ext>" beside the original. | |
| jpeg_ok | No | Let a PNG, WebP, TIFF or BMP come back as a JPEG when that is what fits. Only if the upload accepts JPEG; by default every file keeps its format. | |
| minimum | No | Smallest allowed size, like "10KB", for forms that set one. A small JPEG is padded up to it. |