PHP Replace Colour in truecolorimage
I need to find a colour w开发者_开发问答ithin an image and replace it - if it is present.
All I can find is information about replacing within an indexed image.
Is there an easy way to do it with a true color image?
Is it more efficient to convert a true color image to an indexed one and then replace the colour?
Thanks,
Mark
Use imagetruecolortopalette to create a palette image, then you can use imagecolorexact to find the index of the color you're looking for and then call imagecolorset to change it.
精彩评论