Image Fill Transformation
The Fill feature automatically resizes and crops your images to fit exact dimensions without distortion. This is perfect for creating uniformly sized thumbnails, banners, or any situation where you need images to fit into precise dimensions while maintaining their visual integrity.
Basic Usage
To use the Fill feature in Vyso DAM, specify the target dimensions in your image URL:
https://assets.vyso.io/account_id/image/asset_id/fill,w_600,h_400/asset.jpg
Parameters
Parameter | Description | Example |
---|---|---|
w | Target width in pixels | w_600 |
h | Target height in pixels | h_400 |
g | Gravity (focus point) for the fill operation | g_center (default), g_north , g_south , etc. |
bg | Background color (if padding is needed) | bg_ffffff (white) |
How Fill Works
The Fill operation works in the following way:
- The image is resized to completely cover the target dimensions while maintaining its aspect ratio.
- If the resized image is larger than the target dimensions, it is cropped based on the gravity parameter.
- The result is an image that exactly matches the requested dimensions.
Examples
Basic Fill
To fill a 300×300 square with an image:
https://assets.vyso.io/account_id/image/asset_id/fill,w_300,h_300/asset.jpg
Fill with Custom Gravity
To fill a 600×400 rectangle with focus on the bottom of the image:
https://assets.vyso.io/account_id/image/asset_id/fill,w_600,h_400,g_south/asset.jpg
Gravity Options
The gravity parameter controls which part of the image is preserved during cropping:
g_center
- Focus on the center (default)g_north
- Focus on the topg_northeast
- Focus on the top-rightg_east
- Focus on the rightg_southeast
- Focus on the bottom-rightg_south
- Focus on the bottomg_southwest
- Focus on the bottom-leftg_west
- Focus on the leftg_northwest
- Focus on the top-left
Best Practices
- Choose the right gravity - Select a gravity option that keeps the important parts of your image visible.
- Consider aspect ratios - Be mindful of aspect ratio changes and how they might affect the visual impact of your images.
- Use for UI elements - Fill is perfect for creating consistent UI elements like thumbnails, cards, or profile pictures.