1. Knowledge Base
  2. QBank - Admin User Guides
  3. Introduction to the template Commands

Image template: Extent command

Learn how to enhance your images using the extent command in this article on image processing commands.

The "extent" command is a function in QBank that sets the canvas size of an image. It is often used in conjunction with other commands such as background, resize, and crop, to ensure that the image is properly sized and oriented for a specific output format or display.

One common use case for the "extent" command is to create a square image from an image with a different aspect ratio, such as a 16:9 image. By using the "extent" command, the canvas size can be set to a square shape that letterboxes the image and preserves its original aspect ratio. This can be combined with a background command to set the color of the added space around the image.

If the image is already larger than the specified canvas size, the "extent" command will crop the image with the origin according to the gravity setting. This allows you to control which part of the image is preserved when the canvas is resized or cropped.

Overall, the "extent" command is a useful tool for manipulating image sizes and aspect ratios, allowing you to create images that are optimized for specific uses and display formats.