gdk-pixbuf provides several methods for scaling images and
compositing one image over another or over a checkerboard pattern.
The methods are divided into "simple" and "industrial-strength"
versions. The simple ones are sufficient most of the time, and
underneath they use the more advanced ones transparently.
To make scaled copy of an image, this method can be used:
<?php
GdkPixbuf scale_simple(int $dest_width,
int $dest_height,
GdkInterpType $interp_type)
?>
It takes the desired dimensions to scale to and the interpolation
type constant, which can be:
- • GDK_INTERP_NEAREST (fastest and lowest quality mode)
- • GDK_INTERP_BILINEAR (best quality/speed balance)
- • GDK_INTERP_TILES (resembles PostScript image operator)
- • GDK_INTERP_HYPER (slowest and highest quality mode)
The method will scale the image according to the specified interpolation
algorithm and return the result.