次のコードがあります。
$imagine = new \Imagine\Gd\Imagine();
$image = $imagine->open($src);
$image_size = $image->getSize();
$image_height = $image_size->getHeight();
$image_width = $image_size->getWidth();
$ratio = 1;
$resized_image = $image;
$ratio = $image_width / $desired_width;
$this->resizedHeight = $image_height / $ratio;
$this->resizedWidth = $image_width / $ratio;
// thumbnailDir doesn t exist
if(!is_dir(dirname($des)))
mkdir(dirname($des), 0777, true);
$resized_image = $image->resize(new Box($this->resizedWidth, $this->resizedHeight));
$options = array(
'resolution-units' => ImageInterface::RESOLUTION_PIXELSPERINCH,
'resolution-x' => 500,
'resolution-y' => 500,
'flatten' => false
);
$resized_image->save($des, $options);
何らかの理由で、サイズ変更された画像は常に少しぼやけています。サイズ変更された画像はこちら、元の画像はこちら、サイズ変更された画像はこちらです。これがなぜなのか、私はアイデアを使い果たしています。理由はありますか?