If we read the documentation silverstripe about the image, we will get the reference method used to resize the image on silverstripe. But there are questions on the documentation. How do I change the image size by specifying the width and height of the image from the template file?
The trick is with SetSize method or PaddedImage. Both these methods set the image proportionately width and height. If the specified width and height are not proportionate, then the image will be given a white background.

What if we want the image that really fit either the width or height in size without a white background?
I still have not found a function that could be like that on silverstripe. But I have modify files from Image.php to make that function. The trick is to add the following two methods in the Image Class.
Open the sapphire/core/model/Image.php file then add these two methods in the Image Class:
class Image extends File{
....
public function SetFixedSize($width, $height) {
return $this->getFormattedImage('SetReSize', $width, $height);
}
public function generateSetFixedSize(GD $gd, $width, $height) {
return $gd->resize($width, $height);
}
....
}
After adding these two methods later in the template file (. Ss) we just call the method SetFixedSize to use it like we call the SetSize method. If the Image object named Picture, the template code will be like this:
<% control Picture %>
<% control SetFixedSize(100,120) %>
<img src="$URL"/>
<% end_control %>
<% end_control %>
From the snippet above programs will be created fix image size of 100x120 with no white background.

Editing the core-files isnt a good idea. If you want to upgrade your SS-Installation to a newer version, the folder sapphire/ will be overwritten. So you have to implement all your changes again.
Normally you would extend the image-class, e.g.
class MyImage extends image() {
}
But I think this has a problem as well. If you are uploading images in the files&images tab of the CMS, these images are saved as class "image". So the files&images upload doesnt know that you want your uploaded files to be a "MyImage"-object.
So I think imagemanipulation must be somehow managed by decorating the class image. But i dindt have time to try this out.