def process(self, img): self.watermark.image.seek(0) mark = Image.open(self.watermark.image.file) img = apply_watermark(im=img, mark=mark, position=self.watermark.style, opacity=self.watermark.opacity) return img
def post_process(self, im): mark = Image.open(self.image.path) return apply_watermark(im, mark, self.style, self.opacity)