public function scaled( $width, $height, $aspectRatioMode = AspectRatioMode::IGNORE_ASPECT_RATIO )
    {
        switch( $aspectRatioMode )
        {
            case AspectRatioMode::IGNORE_ASPECT_RATIO:
                break;
            case AspectRatioMode::KEEP_ASPECT_RATIO:
                $height = ($width * $this->getHeight()) / $this->getWidth();
                break;
            case AspectRatioMode::KEEP_ASPECT_RATIO_BY_EXPANDING:
                $width = ($height * $this->getWidth()) / $this->getHeight();
                break;
        }

        $newResource = imagecreatetruecolor( $width, $height );

        imagealphablending( $newResource, false );
        imagesavealpha( $newResource, true );
        imagecopyresampled( $newResource, $this->resource, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight() );

        $newImage = MImage::fromResource( $newResource );
        $newImage->type = $this->type;

        return $newImage;
    }