Image Processing Supports Watermark

By Martin Williams
Published on November 7, 2019
Image Processing Supports Watermark

We’ve extended our Image Processing service with a new watermark feature! This new operation allows an image to be placed on top of another image. It seamlessly integrates into our existing service. The image overlay process consists of two parts, the base image and the overlay image. The base image can still be transformed and optimized with any image processing parameter. Once the base image has been modified, the overlay image is added on top.

Overlay Parameters Overview

The following image processing parameters have been added:

  • olurl Defines the URL of the overlay image. The URL can be plain or encoded.
  • olalign Modifies the alignment of the overlay image (default is center).
  • olx and oly Specifies the location of the overlay image based on pixel coordinates.
  • olwidth Adjusts the width of the overlay image relative to the base image if <=1 or in absolute pixel if >2.
  • olheight Sets the height of the overlay image relative to the base image if <=1 or in absolute pixel if >2.
  • olscale Scales the width of the overlay image in percent to the width of the base image.
  • olpadding Adds padding to the overlay image in pixels (default is 10).
  • olalpha Makes the overlay image transparent.
  • olrepeat Repeats the overlay image multiple times on the base image.

In order to use the overlay operation, the Image Processing setting needs to be enabled. The overlay image format can be svg, jpeg, png, or webp. We recommend using svg as it scales without resolution loss.

Overlay Examples

The following example simply adds the defined overlay image to the center of the base image:

    
        https://ip.keycdn.com/example.jpg?olurl=https://logos.keycdn.com/keycdn-logo-white.svg
    

A common watermark is a semi-transparent overlay image, for example:

    
        https://ip.keycdn.com/example.jpg?olurl=https://logos.keycdn.com/keycdn-logo-white.svg&olalpha=40&olscale=70
    

A logo can easily be placed in a corner of an image, for example:

    
        https://ip.keycdn.com/example.jpg?olurl=https://logos.keycdn.com/keycdn-icon-white.svg&olalign=bottomright&olwidth=80&olpadding=10
    

The overlay image can also be added repeatedly with a defined padding, for example:

    
        https://ip.keycdn.com/example.jpg?olurl=https://logos.keycdn.com/keycdn-icon-white.svg&olheight=100&olpadding=40&olalpha=30&olrepeat=1
    

Summary

Image overlay is a great way to effectively add an image over another. You only need to define the query string and we take care of the rest. If there is another feature that you’re looking for we’d love to hear your feedback on our community page.

Happy image transforming!

Supercharge your content delivery 🚀

Try KeyCDN with a free 14 day trial, no credit card required.

Get started

Comments

KeyCDN uses cookies to make its website easier to use. Learn more about cookies.