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

8-bit and 24-bit PNGs not supported #397

Open
brandonkelly opened this issue Nov 25, 2014 · 0 comments
Open

8-bit and 24-bit PNGs not supported #397

brandonkelly opened this issue Nov 25, 2014 · 0 comments

Comments

@brandonkelly
Copy link

I don’t believe it’s currently possible to create an 8-bit or 24-bit PNG with Imagine; all new PNGs created with Imagine currently end up as 32-bit (4-channel) PNGs. However if you re-save an existing 8/24-bit PNG, both GD and ImageMagick will preserve the file’s allocated colorspace, and save the new image as an 8/24-bit PNG like it should.

Both ImageMagick and GD do have ways to save out new 8/24-bit PNGs. With ImageMagick that's as simple as:

$im->writeImage('png8:filename.png');
$im->writeImage('png24:filename.png');

And here’s how to save an 8-bit PNG using GD: http://stackoverflow.com/a/8547087/1688568

Ideally, you would be able to set the type of PNG that will get saved from $options['format'] when calling Image::save():

$image->save('filename.png', array(
    // ...
    'format' => 'png8'
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant