Images
Generate image with POST request
post
https://api.usestencil.com
/v1/images/sync
Create image synchronously
post
https://api.usestencil.com
/v1/images
Create image asynchronously

Modification object generally follows the following pattern,
"modifications": [
{
"name": "text_1",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do..."
},
{
"name": "rating_3",
"rating": 3.5
}
]
name is a required property.
The name is the field unique identifier in the template editor
The rest of the properties depend on the type of object. If you need full list of supported properties, you can view them in them in API Console.
Console shows all available modifications for each template

For PNG images, you can set png_multiplier to adjust the quality of generated images.
For example, if your template size is 800x800 then setting the png_multiplier to 2 will scale the image to 1600x1600 which creates a higher resolution image.
Please note that higher quality image will increase the image size and will also increase the image generation time.

For JPEG images, you can set jpeg_quality to adjust the quality of generated images. JPEG is a lossy format, while it offers higher compression rate that could decrease the file size, it also degrades the image quality.
You can control this by setting jpeg_quality to a number between 0 and 1 with 1 being the highest quality.
Please note that higher quality image will increase the image size and will also increase the image generation time.

You can also set a default settings for all templates in your project. Go to your project's settings page and set the values accordingly.
You can always override these values in the API by following the instructions mentioned above.
Copy link
On this page
post
Create image synchronously
post
Create image asynchronously
Modification object
Image Quality