Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Adding Text Watermarks with Imagick
Dec 31, 2012 @ 15:15:48

On PHPMaster.com there's a recent tutorial from Martin Psinas about how you can add text to an image with the help of Imagick, the image editing software that's available to PHP via an extension.

In a previous article, Timothy Boronczyk wrote about how to create watermarks with Imagick using an overlay image. In this article, I’ll show you how to achieve a similar effect using plain text.

He takes a sample image (a headshot) and offers two versions of the same functionality - both the shell command (using "convert") and the PHP code that sets up the font to use, adds placement and pushes the result back out as a PNG. He also includes two other types of overlay - a font mask for a more see-through look and a tiled version, overlaying the text all over the image.

tagged: watermark imagick tutorial text overlay mask tile

Link:

Liip Blog:
First Release of Proxy-Object
Jul 15, 2011 @ 16:06:34

On the Liip blog Bastian Feder has announced the first release of a tool that helps you proxy your objects (overlay them with a layer that exposes properties and methods) following the proxy object design pattern in PHP.

The outcome is this little library making it much easier to generate a proxy of your system under test (SUT). Another thought on this library was, that it should be very easy to use if you know the way to mock classes and methods in PHPUnit. Proxy-object has almost the same API, but does not change the behavior of the proxied class/method. The only purpose is to expose hidden methods and members.

The scripts, found on github, give you a simple way to define a proxy over a given class' functionality and define methods/member variables to be exposed. He includes two code examples, one of each type. There's also an example of making the proxy object without calling the constructor, useful in certain cases when the initialization of the object doesn't need to happen.

You can also find out more about the usage of this tool in this new post to Bastian's blog.

tagged: proxy object designpattern overlay tool method member

Link:

Mikko Koppanen's Blog:
Typesetting
Jan 17, 2008 @ 13:58:00

Mikko Koppanen has posted another quick example of using the ImageMagick functionality in PHP - overlaying a string of text over a currently existing image.

Ever had the situation where you have a piece of string which you need to overlay on an image? Maybe a situation where the area reserved for the string is known in pixels but you need to know the font size to fill most of the area? Think no more!

In his example (ready to cut and paste), he defines the text in a variable and, with the help of the newPseudoImage method, adds the text over the top of his sample image. Example input and output is provided.

tagged: imagemagick image graphic typesetting string overlay imagemagick image graphic typesetting string overlay

Link:

Mikko Koppanen's Blog:
Typesetting
Jan 17, 2008 @ 13:58:00

Mikko Koppanen has posted another quick example of using the ImageMagick functionality in PHP - overlaying a string of text over a currently existing image.

Ever had the situation where you have a piece of string which you need to overlay on an image? Maybe a situation where the area reserved for the string is known in pixels but you need to know the font size to fill most of the area? Think no more!

In his example (ready to cut and paste), he defines the text in a variable and, with the help of the newPseudoImage method, adds the text over the top of his sample image. Example input and output is provided.

tagged: imagemagick image graphic typesetting string overlay imagemagick image graphic typesetting string overlay

Link:

Mikko Koppanen's Blog:
Creating a reflection
Nov 20, 2007 @ 16:20:00

Mikko Koppanen has another example of using the Imagick functionality to create an advanced image - this time, it's about adding a reflection (similar to some of the effects Apple uses in their designs).

Here is a simple example of creating a reflection of an image. The reflection is created by flipping the image and overlaying a gradient on it. Then both, the original image and the reflection is overlayed on a canvas.

Both the code and an example image are included in the post.

tagged: imagick example reflection tutorial overlay imagick example reflection tutorial overlay

Link:

Mikko Koppanen's Blog:
Creating a reflection
Nov 20, 2007 @ 16:20:00

Mikko Koppanen has another example of using the Imagick functionality to create an advanced image - this time, it's about adding a reflection (similar to some of the effects Apple uses in their designs).

Here is a simple example of creating a reflection of an image. The reflection is created by flipping the image and overlaying a gradient on it. Then both, the original image and the reflection is overlayed on a canvas.

Both the code and an example image are included in the post.

tagged: imagick example reflection tutorial overlay imagick example reflection tutorial overlay

Link:


Trending Topics: