Places another image atop current image
@param int $x X-position
@param int $y Y-position
@param ImageEditor $image Image to place
@return ImageEditor this object
430806
public function placeImageAt($x, $y, ImageEditor $image) {
		imagecopy($this->_image, $image->resource, $x, $y, 0, 0, $image->width, $image->height);
		return $this;
	}
544764
public function crop($width, $height, $x = null, $y = null)
    {
        $this->toggleModified();

        $this->getInterventionImage()->crop($width, $height, $x, $y);

        return $this;
    }
266068
protected function setPixel(int $x, int $y, array $rgb):void{
		\imagefilledrectangle(
			$this->image,
			$x * $this->scale,
			$y * $this->scale,
			($x + 1) * $this->scale,
			($y + 1) * $this->scale,
			\imagecolorallocate($this->image, ...$rgb)
		);
	}
615389
public function paste(ImageInterface $image, $offsetX = 0, $offsetY = 0)
    {
        $point = new Point($offsetX, $offsetY);

        $this->image->paste($image->getInstance(), $point);

        return $this;
    }
1234692
public function addImage(\Elcodi\Component\Media\Entity\Interfaces\ImageInterface $image)
    {
        $this->images->add($image);

        return $this;
    }
542932
protected function doCrop($width, $height, $x, $y)
  {
    if ($width > $this->getWidth()) {
      $width = $this->getWidth();
    }
    if ($height > $this->getHeight()) {
      $height = $this->getHeight();
    }

    list ($new_x, $new_y) = static::CalculateOffset($x, $y, $this->getWidth(), $this->getHeight(), $width, $height);

    // Прозрачность
    $new_image = imagecreatetruecolor($width, $height);
    imagealphablending($new_image, true);
    imagefill($new_image, 0, 0, imagecolorallocatealpha($new_image, 0, 0, 0, 127));
    imagesavealpha($new_image, true);

    if (!imagecopy($new_image, $this->image, 0, 0, $new_x, $new_y, $width, $height)) {
      Ex::ThrowError(Ex::CROP);
    }

    $this->image = $new_image;

    return $this->updateDimensions();
  }
400887
public function crop($x, $y, $width, $height, $saveAsNewFile = false)
    {

        return $this->modifyImageHelper(
            function (Imagick $imagick) use ($width, $height, $x, $y) {
                $imagick->cropImage($width, $height, $x, $y);
            },
            function () use ($x, $y, $width, $height) {
                return $this->newCropBasename($x, $y, $width, $height);
            },
            function (ImageFile $file) use ($x, $y, $width, $height) {
                $file->crop($x, $y, $width, $height);
            },
            $saveAsNewFile);

    }
512705
public function setPosition($x, $y)
    {
        $this->posX = $x;
        $this->posy = $y;

        return $this;
    }
900957
public function applyToImage(Image $image, $x = 0, $y = 0)
    {
        $circle = new \ImagickDraw;

        // set background
        $bgcolor = new Color($this->background);
        $circle->setFillColor($bgcolor->getPixel());

        // set border
        if ($this->hasBorder()) {
            $border_color = new Color($this->border_color);
            $circle->setStrokeWidth($this->border_width);
            $circle->setStrokeColor($border_color->getPixel());
        }

        $circle->ellipse($x, $y, $this->width / 2, $this->height / 2, 0, 360);

        $image->getCore()->drawImage($circle);

        return true;
    }
828072
public function image($image, $position = 100)
    {
        $this->add(
            [
                'name' => 'image',
                'property' => 'og:image',
                'content' => $image
            ],
            $position
        );

        $this->addElement(
            $position,
            $this->void(
                'link',
                [
                    'rel'  => 'image_src',
                    'href' => $image
                ]
            )
        );
        return $this;
    }
1063044
function mergeLayer( $image, $layerData, $lastLayerData )
    {
        $position = $image->calculatePosition( $layerData['parameters'], $this->width(), $this->height() );
        $x = $position['x'];
        $y = $position['y'];
        $imageObject = $this->imageObject();
        if ( $lastLayerData === null )
        {
            $destinationImageObject = $image->imageObjectInternal( false );
            if ( $destinationImageObject === null )
            {
                $isTrueColor = $this->isTruecolor();
                $image->cloneImage( $this->imageObject(), $this->width(), $this->height(),
                                    $isTrueColor );
            }
            else
            {
                $image->mergeImage( $destinationImageObject, $imageObject,
                                    $x, $y,
                                    $this->width(), $this->height(), 0, 0,
                                    $image->getTransparencyPercent( $layerData['parameters'] ) );
            }
        }
        else
        {
            $destinationImageObject = $image->imageObjectInternal();
            $image->mergeImage( $destinationImageObject, $imageObject,
                                $x, $y,
                                $this->width(), $this->height(), 0, 0,
                                $image->getTransparencyPercent( $layerData['parameters'] ) );
        }
    }
514522
public function moveTo($x, $y, Element $element = null)
    {
        $this->request('POST', 'moveto', json_encode(array(
            'element' => $element ? $element->getId() : null,
            'xoffset' => $x,
            'yoffset' => $y
        )));

        return $this;
    }
1229119
private function fixImageOrientation($image)
    {
        $orientation = $image->getImageOrientation();
        switch ($orientation) {
            case \Imagick::ORIENTATION_UNDEFINED:
                break;
            case \Imagick::ORIENTATION_TOPLEFT:
                break;
            case \Imagick::ORIENTATION_TOPRIGHT:
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_BOTTOMRIGHT:
                $image->rotateImage(new \ImagickPixel(), 180);
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_BOTTOMLEFT:
                $image->rotateImage(new \ImagickPixel(), 180);
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_LEFTTOP:
                $image->rotateImage(new \ImagickPixel(), 90);
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_RIGHTTOP:
                $image->rotateImage(new \ImagickPixel(), 90);
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_RIGHTBOTTOM:
                $image->rotateImage(new \ImagickPixel(), 270);
                $image->flopImage();
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
            case \Imagick::ORIENTATION_LEFTBOTTOM:
                $image->rotateImage(new \ImagickPixel(), 270);
                $image->setimageorientation(\Imagick::ORIENTATION_TOPLEFT);
                break;
        }

        return $image;
    }
69263
public function setImage(\Core\Entity\Image $image = null) {
        $this->image = $image;

        return $this;
    }
183410
function (px) {
        //if no px passed in, use stored location
        if (px != null) {
            this.px = px;
        }

        if (this.imageDiv != null) {
            if (this.px == null) {
                this.display(false);
            } else {
                if (this.calculateOffset) {
                    this.offset = this.calculateOffset(this.size);  
                }
                OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv, null, {
                    x: this.px.x + this.offset.x,
                    y: this.px.y + this.offset.y
                });
            }
        }
    }
748798
public function limitToImageBoundaries(Image $image, array $coordinates)
    {
        if ($coordinates[0] > ($image->width() - $coordinates[2])) {
            $coordinates[0] = $image->width() - $coordinates[2];
        }

        if ($coordinates[1] > ($image->height() - $coordinates[3])) {
            $coordinates[1] = $image->height() - $coordinates[3];
        }

        return $coordinates;
    }
561790
public function fill(&$image, $color, $x = 0, $y = 0)
    {

        if ($image->isAnimated()) { // Ignore animated GIF for now
            return $this;
        }

        $target = $image->getCore()->getImagePixelColor($x, $y);
        $image->getCore()->floodfillPaintImage($color->getHexString(), 1, $target, $x, $y, false);

        return $this;
    }