Shrine

Watermarked derivatives - repeated and opacity

I’m trying to find a way to add a repeated watermark, such as the company logo tiled across the image (at 50% opacity), on a derivative using Shrine and Vips. Is this possible?

I currently have my derivatives setup like this:

Attacher.derivatives_processor do |original|
watermark = "#{Rails.root}/public/icon-192.png"
vips = ImageProcessing::Vips.source(original)
watermarked = vips.composite(watermark, mode: "over", gravity: "south-east", offset: [10, 10]) #multiply?
{
  thumbnail: vips.resize_to_fit!(200, 200),
  watermarked: watermarked.call
}

end