Home » General » Alex » Adding a gradient to an image using Imagick
Imagick allows you to easily add a gradient to an image.
// The gradient$gradient = new Imagick();// Create new Image with size x, size y, “gradient start – gradient end“$gradient->newPseudoImage( 930,20,”gradient:transparent-#838383″);// $im would be the canvas or image you loaded before. This merges both, the image gradient at position x, position y$im->compositeImage( $gradient, imagick::COMPOSITE_OVER, 0, 240 );
This can easily be transformed to create a reflection, by mirroring the original and applying the the gradient to the mirrored image.
Get in touch
I am a full-stack developer. My expertise include:
I love programming, design and know my way around server architecture as well. I would never feel complete, with one of these missing.
I have a broad range of interests, that’s why I constantly dive into new technologies and expand my knowledge where ever required. Technologies are evolving fast and I enjoy using the latest.
Apart from that, I am a peace loving guy who tries to have people around him that think the same. I truly believe in the principle: “If you help someone, someone will help you, when you need it."