Shutterstock watermark png4/12/2023 ![]() ![]() In this post, you’ll learn what you need to know about watermarks and why you should watermark your assets. So, what can you do to reduce the risk of this happening to you? Whether it’s a product image or a piece of art, this kind of theft could keep you from getting the credit you deserve. If you’re a victim of this, it can have an impact on your brand. The method will scale the image down so that the maximum width is no larger than the allowed width, and the maximum height is no larger than the allowed height, while maintaining the image’s aspect ratio.As many as 2.5 billion images are stolen per day on the web. Resizing the watermark is accomplished by calling the scaleImage() method which takes an allowed width and height. By comparing the width and height of the watermark image to the those of the the original image, you can determine whether or not it is necessary to resize the watermark so it will fit on smaller images. The getImageWidth() and getImageHeight() methods return the width and height of an image respectively, measured in pixels. $image->compositeImage($watermark, imagick::COMPOSITE_OVER, $x, $y) If ($iHeight scaleImage($iWidth, $iHeight) Such an approach might be to place the watermark in the center of the image, and scaling the watermark beforehand if it is larger than the original image. While this approach is fine if you know the size of the original images beforehand since you can create the watermark with the appropriate dimensions, you might want a more robust approach in case the sizes of the original images vary. The previous example positioned the watermark at the top-left of the original image. Here’s the end result, a watermarked image: Instead of just hard-coding the Content-Type header’s value, the example accesses the image’s type using Imagick itself which is then used to construct an appropriate MIME type on the fly. To avoid your visitors being greeted with a page of gibberish, you need to instruct PHP to send a more appropriate header using header() before sending the image. If you output the image, the browser won’t handle it properly since the headers tell it you’re sending text. In this example, the method accepts four parameters: the first is the image that will be overlaid, the second is a predefined constant representing which type of composition operation Imagick should perform (there’s a whole slew to choose from to achieve different effects), and the third and fourth parameters are the X and Y coordinates at which to place the watermark measured in pixels from the top-left corner.īy default, PHP assumes your script’s output is HTML and sends a text/html Content-Type header automatically. 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 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 |