PHP 8.5.0 Alpha 4 available for testing

Voting

: four minus zero?
(Example: nine)

The Note You're Voting On

php at roelvanmastbergen dot nl
21 years ago
The palette created by this function often looks quite awful (at least it did on all of my test images). A better way to convert your true-colour images is by first making a resized copy of them with imagecopyresampled() to a 16x16 pixel destination. The resized image then contains only 256 pixels, which is exactly the number of colours you need. These colours usually look a lot better than the ones generated by imagetruecolortopalette().

The only disadvantage to this method I have found is that different-coloured details in the original image are lost in the conversion.

<< Back to user notes page

To Top