-
Notifications
You must be signed in to change notification settings - Fork 82
Watermarking
Dave Harris edited this page Jul 9, 2018
·
6 revisions
A watermark can be applied to an image during processing.
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 from 'gravity' setting
.composite # Perform composition on two images
.call # Apply operationTODO