There seems to be a shortage of GDlib tutorials out in the interweb.
I want to create an image of a solid block of random colour then mask it with a greyscale image so I end up with an image similar to the mask but with a random colour.
After a bit of hunting about I discovered the only way was to change each pixel colour of the mask image which seemed a bit longwinded. Then I found this on the php site:
http://www.php.net/manual/en/function.imagesavealpha.php - Top comment. Someone has written a function to do what I need. Hurrah.
However I have no idea how to get it working.
They say using the function is simple and I have done as they say but I get a huge row of gobbledegook.
If I try adding a ‘header( “Content-type: image/png”);’ anywhere I get headers already sent warnings.
What am I doing wrong? :ponder: