Resize an Image (image_resize)
Resize an image with flexible options for width, height, and aspect ratio. Convert and display original and converted image sizes.
Resize an Image
Purpose
The "Resize an Image" function allows you to adjust the size of an image based on your specifications.
Use Cases
You can use this function to resize an image to a specific width or height, a percentage of the original size, or to custom dimensions.
How to Use
- Upload an image or provide the image URL.
- Select the resizing option (width, height, width percentage, height percentage, custom width and height).
- Enter the desired values for the selected option.
- Click on the "Resize" button to process the image.
Input Values
- Upload Image or Image URL: Select an image file or provide a URL to an image.
- Option: Choose how you want to resize the image (width, height, width percentage, height percentage, custom width and height).
- Width: Enter the desired width for the image.
- Height: Enter the desired height for the image.
- Width Percent: Enter the percentage of the original width for resizing.
- Height Percent: Enter the percentage of the original height for resizing.
Output Values
- Converted Image Size: Displays the width and height of the resized image.
- Original Image Size: Displays the width and height of the original image.
- Converted Image: Shows the resized image.
- Original Image: Displays the original image.
Any other Instructions
- The default unit of measurement is inches.
- Ensure the uploaded image is in a supported format (e.g., JPEG, PNG).
Steps of Calculation
- Determine the aspect ratio of the original image.
- Calculate the new width and height based on the selected resizing option.
- Adjust the dimensions within the specified limits.
- Resize the image accordingly.
Technical Parameters
upload_image, image_url, option, width, height, width_percent, height_percent
Return Values
Converted Image Size, Original Image Size, Converted Image, Original Image
Example Expressions
You can use the following expressions to directly evaluate in a non-interactive manner using eval():
image_resize(upload_image='sample.jpg', option='w', width=800)
image_resize(image_url='https://example.com/image.jpg', option='hp', height_percent=150)
Click on Help icon to open the help page on a separate window.