You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Guys!
I'm using PHP 5.5 and tried Gmagick, Imagick and GD
Start with this image `ìnput.jpg`` (800x1200px) - color is CORRECT:
$imagine = newImagine();
/* set height to 800px (current 1200px) */$file = $imagine->open($inputFile);
$size = $file->getSize();
$targetSize = newBox($size->getWidth(), $size->getHeight());
$file->resize($targetSize->heighten(800))->save($tempOutputFile);
/* get the resized image 533x800px*/$createdFile = $imagine->open($tempOutputFile);
Temp image temp_outpur.jpgis no 533x800px - color is STILL CORRECT:
/* we need 667x800px so i want to apply white pixels to right and the left/* drawing a new image with the needed pixels */$newBox = newBox(667, 800);
$emptyImage = $imagine->create($newBox);
$size = $emptyImage->getSize();
$wSize = $createdFile->getSize();
/* calculate the center x-point */$x = ($size->getWidth() / 2) - ($wSize->getWidth() / 2);
$center = newPoint($x, 0);
/* paste the temp_output.jpg onto the created file */$emptyImage->paste($createdFile, $center);
$emptyImage->save($outputFile);
The result output.jpg 667x800px - color is INCORRECT:
Here is a Side-by-Side diff (output.jpg is a little bit gray....):
Activity
OskarStark commentedon May 19, 2015
anybody?
mvhirsch commentedon May 19, 2015
I tried with imagick and gd.
I also skipped the temporary save within this to lines to save image quality:
But neither things worked for me. Please help!
coalexe commentedon Jan 4, 2016
Got the same problem. Image is grayed out a little.
Marc-pi commentedon Mar 6, 2016
we have also this behavior when image are downsized (landscape highres pictures)
@romainneutron any idea ? merci !
azhidkov commentedon Aug 8, 2016
I had the similar problem when after image resizing colors become a little bit "zombie". And I've used this code for resizing:
Solution for me was comment the line with image stripping:
in method
\Imagine\Image\AbstractImage::thumbnail.Image weight become more but the quality is good.
KacerCZ commentedon Aug 30, 2018
I've encountered the same problem.
Cause of this problem is, that color profile is removed in
strip().This modification of
\Imagine\Image\AbstractImage::thumbnail()copies color profile from original image to thumbnail: