Based on sunil-antony's answer, I came up with the following solution (using save_graphics_state
to enclose drawing instructions, see Prawn documentation):
Prawn::Document.generate("x.pdf") do
image_width = 200
image_x = 100
image_y = 100
save_graphics_state do
soft_mask do
fill_color 0,0,0,0
fill_circle [image_x + image_width/2, image_y - image_width/2], image_width/2
end
image "example.jpg", at: [image_x, image_y], width: image_width, height: image_width
end
end