|  Download Image> Imageclass is the parent class forFigureandCanvasclasses. SoFigureandCanvasbe able to access tosave(),crop(),output()and other methods provided byImage. SavingThe example below loads and external imagen and save it on local. !!! tip "Tip" `load(f)` function can load an image file from any url or local valid path.
 <?php
use GImage\Image;
$img = new Image();
$img
	->load('https://i.imgur.com/G5MR088.png')
	->scale(0.5)
    ->save('/home/my_user/images/myimage.png');
 OutputLoading an image from local path, scale (50%) and output it on the browser. <?php
use GImage\Image;
$img = new Image();
$img
	->load('/home/my_user/images/my_image.png')
	->scale(0.5)
	->output();
 Preserve resourcesave()andoutput()functions remove the image resource _in memory_ after processing.
To preserve the image resource for future processings only callpreserve()function before saving or outputing, thenpreserve(false)when your processing have been completed.
 <?php
use GImage\Image;
$img = new Image();
$img
	->load('/home/my_user/images/my_image.png')
    ->centerCrop(50, 50)
    // preserve the resource before save
    ->preserve();
    // save only
	->save();
    // remove the resource after output
	->preserve(false);
    // output and remove the resource
	->output();
 Reuse Image functionsFigureandCanvasextend fromImage. This means that it's possible to use many inherited functions likesave(),crop(),rotate()and so on.
 For example the code below creates an rectangle, set an opacity to 75% and save it as PNG. <?php
use GImage\Figure;
$figure = new Figure(400, 250);
$figure
    ->setBackgroundColor(0, 0, 255)
    ->setOpacity(0.75)
    ->create()
    ->save('/home/my_user/images/reactangle.png');
 |