Skip to main content

A little tool to add water mark on various pictures

Project description

WaterMarkTool

A little tool to add water mark on various pictures

def paste_image_on_another(
    top_left_pos,
    bg_img_path=None,
    bg_img=None,
    paste_img_path=None,
    paste_img=None,
    save_as=None,
    transparency = 255,
):
    bg_img = Image.open(bg_img_path) if bg_img_path != None else bg_img
    paste_img = Image.open(paste_img_path) if paste_img_path != None else paste_img
    
    if bg_img == None or paste_img == None:
        raise Exception("bg_img or paste_img not specified")
    
    bg_img = bg_img.convert('RGB')
    paste_img = paste_img.convert('RGBA')
    paste_img.putalpha(transparency)
    bg_img.paste(paste_img, top_left_pos, mask=paste_img)

    if save_as != None:
        bg_img.save(save_as)

    return bg_img

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WaterMarkTool-0.0.8.tar.gz (1.6 kB view details)

Uploaded Source

File details

Details for the file WaterMarkTool-0.0.8.tar.gz.

File metadata

  • Download URL: WaterMarkTool-0.0.8.tar.gz
  • Upload date:
  • Size: 1.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.10

File hashes

Hashes for WaterMarkTool-0.0.8.tar.gz
Algorithm Hash digest
SHA256 c22ffc43517026b51c496fa84e20c19d59c46ad345b9e234503cfe4d104de702
MD5 b565e9a4b06b794701b48f4d88c26dff
BLAKE2b-256 b9ecf4a693f721255c510ad5fab5465e677eb7f2d2e1d4b06b2352bf9aeaa9f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page