code: def im_watermark(im, inputtext, font=None, color=None, opacity=.6, margin=(30, 30)):
      
      if im.mode != "RGBA":
          im = im.convert("RGBA")
      textlayer = Image.new("RGBA", im.size, (0, 0, 0, 0))
      textdraw = ImageDraw.Draw(textlayer)
      textsize = textdraw.textsize(inputtext, font=font)
      textpos = [im.size[i] - textsize[i] - margin[i] for i in [0, 1]]
      textdraw.text(textpos, inputtext, font=font, fill=color)
      if opacity != 1:
          textlayer = reduce_opacity(textlayer, opacity)
      return Image.composite(textlayer, im, textlayer)
docs: imprints a PIL image with the indicated text in lower-right corner