ImageTools

User Documentation: Examples: Resizing

Example Code
HTML <img alt="My resized image" src="?image=images/plain.jpg&size=[size]" />
PHP <?php
include("class.php");
$vif->image("images/plain.jpg");
$vif->size("[size]");
$vif->processimage();
?>
Example Images
Processed Image Original Image
Basic Resizing "123,150" (Width and Height)
Use Preset "smaller" (This minimizes image to 50%)
Let's Use Another Preset: "icon" (An average icon size of 16 pixels)
Let's Do One More Preset: "button" (An average button size of 88 x 31) View all 82 size presets listed here
Set Identical Width and Height "123" or "123,123"
Constrain Proportions "@123"
Resize by Unit "1in" (1 inch)
Resize by Another Unit "75pct" (75% percent)
Resize by Yet Another Unit... And Another Unit "5cm,50mm" (5 centimeters by 50 milimeters) View all 8 size units listed here
Do Some Adding "+10" (Size added by 10)
Or Do Some Subtraction... And Multiplication, Too "325-,*1.2" (Width: 325 subtracted by size / Height: size multiplied by 1.2)
Or Even Better, Randomizing "20~200" (Randomize 20 through 200) View all 8 size calculations listed here
And You Can Resize and Resize Again (Resized at 10 pixels and resized again at 100 pixels)

Formats

Smaller Image Larger Image Original Image
JPG
GIF
GIF Animation
PNG 8
PNG 24
BMP