1

Let's say I have some original jpg image and I want to add red with 50% opacity over the image and display it on the page, how it's done with GD? Please just point me in the right direction, my googling and searching didn't give me much results, or maybe I don't know what I'm searching for because english isn't my 1st language.

Example from photoshop: enter image description here

Sunny
  • 207
  • 2
  • 13

1 Answers1

2

Well, you could either draw a rectangle and

$red = imagecolorallocatealpha($image, 255, 0, 0, 63);

Or you could use the PHP Image filters,

imagefilter($image, IMG_FILTER_COLORIZE, 127, 0, 0);

// didn't test the color though

argentum47
  • 2,385
  • 1
  • 18
  • 20