src/Respimg.php
public function smartResize($columns, $rows, $optim = false) {

			$this->setOption('filter:support', '2.0');
			$this->thumbnailImage($columns, $rows, false, false, \Imagick::FILTER_TRIANGLE);
			if ($optim) {
				$this->unsharpMaskImage(0.25, 0.08, 8.3, 0.045);
			} else {
				$this->unsharpMaskImage(0.25, 0.25, 8, 0.065);
			}
			$this->posterizeImage(136, false);
			$this->setImageCompressionQuality(82);
			$this->setOption('jpeg:fancy-upsampling', 'off');
			$this->setOption('png:compression-filter', '5');
			$this->setOption('png:compression-level', '9');
			$this->setOption('png:compression-strategy', '1');
			$this->setOption('png:exclude-chunk', 'all');
			$this->setInterlaceScheme(\Imagick::INTERLACE_NO);
			$this->setColorspace(\Imagick::COLORSPACE_SRGB);
			if (!$optim) {
				$this->stripImage();
			}

		}
public function smartResize($columns, $rows, $optim = false) {

			$this->setOption('filter:support', '2.0');
			$this->thumbnailImage($columns, $rows, false, false, \Imagick::FILTER_TRIANGLE);
			if ($optim) {
				$this->unsharpMaskImage(0.25, 0.08, 8.3, 0.045);
			} else {
				$this->unsharpMaskImage(0.25, 0.25, 8, 0.065);
			}
			$this->posterizeImage(136, false);
			$this->setImageCompressionQuality(82);
			$this->setOption('jpeg:fancy-upsampling', 'off');
			$this->setOption('png:compression-filter', '5');
			$this->setOption('png:compression-level', '9');
			$this->setOption('png:compression-strategy', '1');
			$this->setOption('png:exclude-chunk', 'all');
			$this->setInterlaceScheme(\Imagick::INTERLACE_NO);
			$this->setColorspace(\Imagick::COLORSPACE_SRGB);
			if (!$optim) {
				$this->stripImage();
			}

		}
public function smartResize ( $ columns , $ rows , $ optim = false ) { $ this -> setOption ( 'filter:support' , '2.0' ) ; $ this -> thumbnailImage ( $ columns , $ rows , false , false , \ Imagick :: FILTER_TRIANGLE ) ; if ( $ optim ) { $ this -> unsharpMaskImage ( 0.25 , 0.08 , 8.3 , 0.045 ) ; } else { $ this -> unsharpMaskImage ( 0.25 , 0.25 , 8 , 0.065 ) ; } $ this -> posterizeImage ( 136 , false ) ; $ this -> setImageCompressionQuality ( 82 ) ; $ this -> setOption ( 'jpeg:fancy-upsampling' , 'off' ) ; $ this -> setOption ( 'png:compression-filter' , '5' ) ; $ this -> setOption ( 'png:compression-level' , '9' ) ; $ this -> setOption ( 'png:compression-strategy' , '1' ) ; $ this -> setOption ( 'png:exclude-chunk' , 'all' ) ; $ this -> setInterlaceScheme ( \ Imagick :: INTERLACE_NO ) ; $ this -> setColorspace ( \ Imagick :: COLORSPACE_SRGB ) ; if ( ! $ optim ) { $ this -> stripImage ( ) ; } }
Resizes the image using smart defaults for high quality and low file size.

This function is basically equivalent to:

$optim == true: `mogrify -path OUTPUT_PATH -filter Triangle -define filter:support=2.0 -thumbnail OUTPUT_WIDTH -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB INPUT_PATH`

$optim == false: `mogrify -path OUTPUT_PATH -filter Triangle -define filter:support=2.0 -thumbnail OUTPUT_WIDTH -unsharp 0.25x0.25+8+0.065 -dither None -posterize 136 -quality 82 -define jpeg:fancy-upsampling=off -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB -strip INPUT_PATH`

@access	public

@param	integer	$columns		The number of columns in the output image. 0 = maintain aspect ratio based on $rows.
@param	integer	$rows			The number of rows in the output image. 0 = maintain aspect ratio based on $columns.
@param	bool	$optim			Whether you intend to perform optimization on the resulting image. Note that setting this to `true` doesn’t actually perform any optimization.
Resizes the image using smart defaults for high quality and low file size .