[php-src] PR #17270: Support alternative color quantization algorithms
| From: | cmb69 | Date: | Wed, 25 Dec 2024 19:19:13 +0000 |
| Subject: | [php-src] PR #17270: Support alternative color quantization algorithms | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30113@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17270
Author: cmb69
As is, ext/gd only supports the default color quantization algorithm, which is used for
imagetruecolortopalette(). However, libgd supports alternative algorithms as of GD
2.1.0, namely NeuQuant (which is built in) and libimagequant (which is used by pngquant).
We add support for these alternative color quantization algorithms as small wrappers around the two
respective libgd functions, introducing also a couple of constants. We also add the nnquant module
to our bundled libgd.
---
TODO:
- [ ] add tests
- [ ] add support for libimagequant to bundled libgd (no-go for official Windows binaries since GPL,
though)
References:
https://libgd.github.io/manuals/2.3.3/files/gd_topal-c.html