![]() To overlay the watermark image, you use the compositeImage() method. One nice thing about Imagick is that it can open any time of file that ImageMagick was compiled to support, so you don’t need to explicitly tell it that the file is a JPEG or PNG it’s smart enough to figure it out on its own. You can open images from a path by creating a new instance of the Imagick class and using its readImage() method. $image->compositeImage($watermark, imagick::COMPOSITE_OVER, 0, 0) Overlay the watermark on the original image $watermark->readImage("/path/to/watermark.png") Here’s the code: readImage("/path/to/image.jpg") This is what iStockPhoto and Shutterstock do, and their mark is easily visible on all of their images whether the original image is light or dark.įor this article I’ll be using this as my watermark, a PNG file with about 40% opacity:Īdding the watermark is a simple 4-step process: first you open the original image, next you open the watermark, then you overlay the watermark on top of the first image, and then either save or output the result. Consider making the watermark dark with a light stroke or visa-versa. See how iStockPhoto and Shutterstock watermark their work for an example.įinally, the watermark should have contrast. Watermarks that cover a large portion of the original image are more effective. If you simply put a small watermark in the lower right-hand corner, it’s a prime target for being cropped out. You also want the watermark to be large enough. A 40% opacity level is probably a good starting point, and you can increase it or decrease it depending on the situation. ![]() ![]() It’s important that the watermark is transparent enough for you to still be able to see the original image, but opaque enough so it’s difficult for an unscrupulous person to remove. For example, these two prairie dog pictures from Shutterstock make a good test pair: I suggest that you try to find at least one test photo that is very light, and another that is very dark. For a watermark to be effective, it needs to visible against a wide variety of backgrounds. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |