4

我使用 imagetruecolortopallete 将位图像从 24 位 rgb 减少到 8 位 rgb,但结果图像与来自 tinypng.com 的图像不一样我该怎么办?

原始图像 24 位 rgb

图像 8 位 rgb 由我的代码转换

24位

8位坏

图像 8 位 rgb 由 tinypng.com 转换

8位还行

[Spektre]:抱歉不是整张图片,但我失去了耐心,源链接太慢/不稳定(第三次尝试下载后花了大约 20 分钟......)

<?php
$im = imagecreatetruecolor(1024, 768);
imagetruecolortopalette($im, true, 255);
imagepng($im, 'cat.png');
imagedestroy($im);
?>
4

0 回答 0