开发者

PHP Replace Colour in truecolorimage

开发者 https://www.devze.com 2022-12-09 17:39 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消