If you are creating a palette image from scratch you have to use imagecolorallocate() for each index before you can use imagecolorset() on it.
If you are creating a palette image from scratch you have to use imagecolorallocate() for each index before you can use imagecolorset() on it.