July 29th, 2010, 09:28 AM
Change colour of an image w/ PHP GD
I'm currently building a fairly basic t-shirt design site, which lets people pick a t-shirt colour, a template, font, and imprint colour, which thus far is working fine.
What happens is that it overlays a PNG of whatever design template they choose over top of the shirt. Is there a way that I can create just a black template PNG file, and change the colour of it with PHP GD? If so, what is the method for it?
July 29th, 2010, 10:52 AM
You could try imagefilter() with the IMAGE_FILTER_COLORIZE constant.
Comments on this post
July 29th, 2010, 11:04 AM
That's the one! Many thanks!
April 7th, 2013, 11:12 PM
Hi I'm trying to replicate the same type of thing but not having any luck. Color seems to come out faded. Any chance I can see how it was done? Thanks...
Originally Posted by ran_dizolph