Output formats, sizes and PDF pages
One template gives PNG, JPEG, WebP, SVG or PDF files, in its main size and up to 19 extra sizes. Pick the format with format and the sizes with sizes.
Formats
| format | Content-Type | Background | scale | quality | Notes |
|---|---|---|---|---|---|
png | image/png | Transparent where nothing is drawn | Yes | No | Lossless. |
jpg | image/jpeg | White where nothing is drawn | Yes | Yes | Baseline JPEG. |
webp | image/webp | Transparent where nothing is drawn | Yes | Yes | |
svg | image/svg+xml | Transparent where nothing is drawn | No | No | Text is drawn as outlines, so no fonts are needed to show it. Images are inside the file as data URLs. |
pdf | application/pdf | As the template | No | No | One PDF page per template page. Vector shapes and text, with text you can select and search. |
A template with no background colour, gradient or image has a transparent background. Images (PNG, JPEG, WebP, SVG) draw the first page of the template. A PDF has every page.
Sizes
Every template has the size main: the canvas width and height. It can have up to 19 extra sizes, each with a name, a width, a height and its own positions for each layer. In the editor, the sizes bar adds them from these presets and scales the layout. You then fix what needs it.
| Preset name | For | Width × height (px) |
|---|---|---|
og | Open Graph | 1,200 × 630 |
square | Square post | 1,080 × 1,080 |
story | Story | 1,080 × 1,920 |
youtube | YouTube thumbnail | 1,280 × 720 |
linkedin | LinkedIn post | 1,200 × 627 |
a4 | A4 | 794 × 1,123 |
a4-landscape | A4 landscape | 1,123 × 794 |
letter | US Letter | 816 × 1,056 |
- Ask for sizes by name:
"sizes": ["main", "og", "square"]. Each size is one file and costs one credit (or one per page for a PDF). - One request may ask for up to 20 sizes. More than 5 makes it a job.
- An unknown name is a 400 whose message lists the template's sizes.
- A size name is 1 to 32 lowercase letters, digits,
_or-. - Per size, a layer can change
x,y,w,h,rotation,visibleand, for text,size.
Scale and quality
scale (0.1 to 4, default 1) multiplies the pixel size of PNG, JPEG and WebP files. A 1200 × 630 template at scale 2 gives a 2400 × 1260 file for screens with dense pixels. A different scale is a different file and costs a credit. quality (1 to 100, default 90) sets JPEG and WebP compression: lower is smaller and less sharp.
Pages and PDF
- A template has 1 to 100 pages. Each page has its own layers and can have its own background.
- A PDF costs one credit per page per size. A 3-page certificate in one size costs 3 credits.
- A sync render makes a PDF of up to 10 pages. Longer PDFs are jobs. Signed links make PDFs of up to 10 pages.
- Set a value on one page with
page2.title. A plaintitlesets every page that has it. - The page size is the canvas size, with 1 px = 0.75 pt (96 px per inch).
- Text is drawn as exact outlines, with a hidden text layer on top so it can be selected and searched. Emoji have no text form.
- Layers with a gradient, blur, shadow, blend mode or image filters are drawn as pictures inside the PDF. Their text stays selectable.
- Images inside a PDF are JPEG or PNG. WebP and GIF images become PNG.
- Two renders of the same PDF can differ in their bytes. The stored file is still reused for the same input.
| Preset | Pixels | PDF page |
|---|---|---|
| A4 | 794 × 1,123 | 595.5 pt × 842.25 pt |
| A4 landscape | 1,123 × 794 | 842.25 pt × 595.5 pt |
| US Letter | 816 × 1,056 | 612 pt × 792 pt |
Pixel limits
- One image may have at most 8,294,400 pixels (3840 × 2160) after scale. A 2000 × 2000 template at scale 2 is over it.
- The images a render draws may have at most 16 megapixels together, decoded.
- A render may need about 96 MB of memory at most. The API checks this before it draws.
Over a limit, the answer is 400 limit with the limit in the message. All limits are on the Limits page.
Seen MintRender used for content that breaks our terms? Report it. Questions about the API: support@mintrender.com, with the request id.