Search code examples
phpimagecolorsblending

Possible to blend an image into a color? (Left, right, bottom)


Is it possible to blend the left, right and bottom sides of an image into a color?
Lets say, I want the image to be blended into the color "#F0F0F0". I want the image to appear as an actual part of the background, so I thought it would look cool if it was blended in.


Solution

  • You can do this by using an image-manipulation library like ImageMagick or GD. I found this page where the author uses a gradient to perform blending using GD.

    You can also try using Imagick::colorizeimage

    UPDATE

    Based on your screenshot, I don't see why you couldn't do what you wanted to with just straight HTML+CSS. You can either use a transparent PNG or you can use -moz-opacity, opacity or filter:alpha in your CSS (Cross-browser Transparency via CSS).