public function processImage($image, $output = null, $imagineOptions = [], $operations = []) {
		if (is_string($image)) {
			$this->_processor->open($image);
			$image = $this->_processor->image();
		}
		if (!$image instanceof AbstractImage) {
			throw new \InvalidArgumentException('An instance of `\Imagine\Image\AbstractImage` is required, you passed `%s`!', get_class($image));
		}

		$event = $this->_table->dispatchEvent('ImagineBehavior.beforeApplyOperations', compact('image', 'operations'));
		if ($event->isStopped()) {
			return $event->result;
		}

		$data = $event->data();
		$this->_applyOperations(
			$data['operations'],
			$data['image']
		);

		$event = $this->_table->dispatchEvent('ImagineBehavior.afterApplyOperations', $data);
		if ($event->isStopped()) {
			return $event->result;
		}

		if ($output === null) {
			return $image;
		}

		return $this->_processor->save($output, $imagineOptions);
	}