Skip to content
Dave Harris edited this page Jul 9, 2018 · 6 revisions

A watermark can be applied to an image during processing.

MiniMagick

From the composite documentation:

Take the first image 'destination' and overlay the second 'source' image according to the current -compose setting. The location of the 'source' or 'overlay' image is controlled according to -gravity, and -geometry settings.

watermark = ImageProcessing::MiniMagick.call(File.open("path/to/watermark.jpg"))

ImageProcessing::MiniMagick
  .source(original)
  .append(watermark.path) 
  .compose('Over') # Apply the watermark 'over' the source
  .gravity('SouthEast') # Apply the watermark in the bottom right corner
  .geometry('+10+10') # Apply the watermark 10 pixels up and left of the bottom right corner
  .composite # Perform composition on two images
  .call # Apply operation

Vips

TODO

Clone this wiki locally