Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White (#FFFFFF) becomes yellowish (#FCFEFC) while resizing GIF #763

Open
raidoa opened this issue Aug 5, 2017 · 3 comments
Open

White (#FFFFFF) becomes yellowish (#FCFEFC) while resizing GIF #763

raidoa opened this issue Aug 5, 2017 · 3 comments

Comments

@raidoa
Copy link

raidoa commented Aug 5, 2017

Hi,

Just discovered a challenge where uploaded GIF files will be turned bit yellow after resizing.
JPG and PNG are fine.

Will it go under bug or is something missing from the code?

Using version 2.4 with rather plain code:

use Intervention\Image\ImageManagerStatic as Image;

$inputFile = "input.gif";
$img = Image::make($inputFile)->widen(1024, function ($constraint) {
    $constraint->upsize();
  }
);
$img->save("output.gif");

output.gif:
output

input.gif:
input

@ghost
Copy link

ghost commented Aug 9, 2019

I realize this issue was created over 2 years ago now, but I am seeing the same issue with GIFs in version 2.5. This is the single mention of the issue that I've been able to find anywhere on the interwebs. I'd be grateful if anyone had any suggestions on a fix or workaround.

@Sublan
Copy link

Sublan commented Oct 28, 2020

use Imagick;
$im = new Imagick($image);
$im->resizeImage(500,582,(FIlter),1,false);
that filter para causing the issues,if I resize without (filter),param (No change in color in output image).
Resize Using Imagick Solves,But I dnt know how to edit resize method in Intervention.

@olivervogel
Copy link
Member

olivervogel commented Aug 17, 2024

Unfortunately, this happens when GIF formats (with an indexed color palette) are converted with the GD Library to Truecolor and then transformed back to an indexed color format.

This is only indirectly related to this library.:

// example without intervention image
$gd = imagecreatefromgif('ffffff.gif'); // complety white image
imagepalettetotruecolor($gd);
imagegif($gd, 'output.gif'); // white becomes yellowish

With Intervention Image, all formats are always normalized to truecolor format with GD. This ensures that the image quality is maintained during operations.

Unfortunately, I cannot offer a bugfix at the moment and can only recommend switching to Imagick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants