I want to convert some of my square 1:1 images into a slightly vertical aspect ratio like 3:4. I tried using the default resizing parameters, but that crops out the image. What other options do I have with ImageKit to change the aspect ratio of the image without cropping? Can it intelligently use AI to adjust the aspect ratio?
Original Square Image:
https://ik.imagekit.io/ikmedia/docs_images/Community/5-Bottoms-Desktop_sNFmAFvWF%20(2).webp
To convert square images into a vertical aspect ratio, you can use the cm-pad_resize transformation. This method adds padding to the image, ensuring the square image is transformed into a vertical format without any cropping.
Example using cm-pad_resize
:
https://ik.imagekit.io/ikmedia/docs_images/Community/5-Bottoms-Desktop_sNFmAFvWF%20(2).webp?tr=w-500,ar-3-4,cm-pad_resize
Additionally, ImageKit offers an AI-powered generative fill transformation (bg-genfill), allowing seamless conversion of a square image into a vertical format without cropping or padding. This transformation intelligently fills the extended areas to maintain a natural appearance.
Example using AI-based bg-genfill
:
https://ik.imagekit.io/ikmedia/docs_images/Community/5-Bottoms-Desktop_sNFmAFvWF%20(2).webp?tr=w-500,h-667,cm-pad_resize,bg-genfill
These options provide flexibility in adapting images to different aspect ratios.