Scales this image.

@return Image
7397
public function rescale($x, $y) {
		if(is_object($x) && $x instanceof Dimensions) {
			$y = $x->height;
			$x = $x->width;
		}
		$newImage = imagecreatetruecolor($this->width * $x, $this->height * $y);
		$x = imagesx($newImage);
		$y = imagesy($newImage);
		imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $x, $y, $this->width, $this->height);
		$this->image = $newImage;
		$this->getSize();
		return $this;
	}
300375
private function applyScale(ImageInterface $image, $scale)
    {
        return $this->modifyAllLayers(
            $image,
            function(ImageInterface $layer) use ($scale) {
                return $this->scaler->scale(
                    $layer,
                    $scale['x'],
                    $scale['y'],
                    $scale['mode'],
                    $scale['forceRatio'],
                    $scale['retina']
                );
            }
        );
    }
511259
function scaleImageHeight( $imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData )
    {
        $geometry = $this->calculateFixedHeightAspectGeometry( ImageSX( $imageObject ), ImageSY( $imageObject ),
                                                               $filterData['data'][0], true );
        return $this->scaleImageCopy( $imageObject,
                                      $geometry,
                                      $sourceMimeData, $destinationMimeData );
    }
1370249
public function grayscale()
    {
        $gray = min(
                255
                , round(
                        0.299 * $this->getRed() +
                        0.587 * $this->getGreen() +
                        0.114 * $this->getBlue()
                )
        );

        return $this->setFromArray(array(
                    $gray, $gray, $gray, $this->getAlpha()
        ));
    }
519706
private ImageScale scaleImage(int imageX, int imageY, int containerX, int containerY) {
		ImageScale ret = new ImageScale();
		// Compare aspects faster by multiplying out the divisors.
		if (imageX * containerY > imageY * containerX) {
			// Image aspect wider than container
			ret.scale = (float) containerX / imageX;
			ret.deltaY = ((float) containerY - (ret.scale * imageY)) / 2.0f;
		} else {
			// Image aspect taller than container
			ret.scale = (float) containerY / imageY;
			ret.deltaX = ((float) containerX - (ret.scale * imageX)) / 2.0f;
		}
		return ret;
	}
582555
public static void scale(Image srcImg, OutputStream out, float scale) throws IORuntimeException {
		scale(srcImg, getImageOutputStream(out), scale);
	}
1198872
public function getSize()
    {

        if ($this->size) {
            return $this->size;
        }

        $this->size = new Size($this->__get('width'), $this->__get('height'));

        return $this->size;
    }
2003
private function getImageRtfHeight()
    {
        if ($this->_height > 0) {
            return PHPRtfLite_Unit::getUnitInTwips($this->_height);
        }

        $imageHeight = $this->_imageHeight ? $this->_imageHeight : 100;
        if ($this->_width > 0) {
            $imageWidth = $this->_imageWidth ? $this->_imageWidth : 100;
            $height = ($imageHeight /$imageWidth) * $this->_width;
            return PHPRtfLite_Unit::getUnitInTwips($height);
        }

        return PHPRtfLite_Unit::getPointsInTwips($imageHeight);
    }
458198
protected function resizeImage()
    {
        $resized = false;

        if ($utilsPic = $this->getImageHandler()) {
            // checks if image can be resized, and resizes the image
            if ($utilsPic->resizeImage($this->getImagePath(), $this->getResizedImagePath(), $this->getWidth(), $this->getHeight())) {
                $resized = true;
            }
        }

        return $resized;
    }
401879
def scale_to(self, width_height=Vector2()):
        """"""
        scale_amt = Vector2()
        scale_amt.X = float(width_height.X) / self.image.get_width()
        scale_amt.Y = float(width_height.Y) / self.image.get_height()
        self.set_scale(scale_amt)
1149651
public function getAsImage()
    {
        if ($this->asImage === null) {
            $this->asImage = $this->getGenerator()->generateImage($this);;
        }
        return $this->asImage;
    }
182933
public function grayscale()
	{
		if ( $this->test() )
		{
			if ( class_exists('\\Imagick') )
			{
				if ( !$this->img->modulateImage(100,0,100) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
			else if ( function_exists('imagefilter') )
			{
				if ( !imagefilter($this->img,IMG_FILTER_GRAYSCALE) ){
					$this->error = \defined('BBN_THERE_HAS_BEEN_A_PROBLEM') ?
						BBN_THERE_HAS_BEEN_A_PROBLEM : 'There has been a problem';
				}
			}
		}
		return $this;
	}
766531
protected function reduceImage()
    {
        $imResampled = imagecreatetruecolor($this->width, $this->height);
        imagecopyresampled($imResampled, $this->im,
            0, 0, 0, 0,
            $this->width, $this->height,
            $this->width*$this->scale, $this->height*$this->scale
        );
        imagedestroy($this->im);
        $this->im = $imResampled;
    }
1270689
function scaleImageWidth( $imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData )
    {
        $geometry = $this->calculateFixedWidthAspectGeometry( ImageSX( $imageObject ), ImageSY( $imageObject ),
                                                              $filterData['data'][0], true );
        return $this->scaleImageCopy( $imageObject,
                                      $geometry,
                                      $sourceMimeData, $destinationMimeData );
    }
957174
function scaleImagePercent( $imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData )
    {
        $geometry = $this->calculateScaledPercentAspectGeometry( ImageSX( $imageObject ), ImageSY( $imageObject ),
                                                                 $filterData['data'][0] / 100.0, $filterData['data'][1] / 100.0, true );
        return $this->scaleImageCopy( $imageObject,
                                      $geometry,
                                      $sourceMimeData, $destinationMimeData );
    }
769347
function scaleImage( $imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData )
    {
        $geometry = $this->calculateScaledAspectGeometry( ImageSX( $imageObject ), ImageSY( $imageObject ),
                                                          $filterData['data'][0], $filterData['data'][1], true );
        return $this->scaleImageCopy( $imageObject,
                                      $geometry,
                                      $sourceMimeData, $destinationMimeData );
    }
975704
public function image()
    {
        if ($image = $this->articleImage()) {
            return $image;
        }
        if ($image = $this->introImage()) {
            return $image;
        }

        return config('article.image');
    }