font = ImageFont.truetype("Dro" /> font = ImageFont.truetype("Dro" /> font = ImageFont.truetype("Dro"/>

Water marker for images.

Overview

watermarker

linux users:

To fix this error,please add truetype font path
font = ImageFont.truetype("DroidSansMono.ttf",txtsize) File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 228, in truetype return FreeTypeFont(font, size, index, encoding) File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 131, in __init__ self.font = core.getfont(font, size, index, encoding) IOError: cannot open resource">
 File "watermark.py", line 58, in <module>
    font = ImageFont.truetype("DroidSansMono.ttf",txtsize)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 228, in truetype
    return FreeTypeFont(font, size, index, encoding)
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFont.py", line 131, in __init__
    self.font = core.getfont(font, size, index, encoding)
IOError: cannot open resource

#####note: linux users, please include truetype font path

font = ImageFont.truetype("/usr/share/fonts/truetype/droid/DroidSansMono.ttf",txtsize)

=

water marker for images

requirements: python 2.7 and PIL(Python image library)

first, create a folder(images) and put all your images inside the folder (Don't change the name of the folder)

images inside the folder(images)

if you want to add logo watermark. create logo folder(don't change name of the folder)

logo image inside the logo folder

next double click the watermark.py python file and enter the choice

processing

water marked images folder created to store the water marked images

sample water marked image with text only

sample water marked image with logo only

sample water marked image with both logo and text

for more sample images click water_marked_samples folder

Reference : http://www.pythonware.com/media/data/pil-handbook.pdf

You might also like...
Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.

django-image-cropping django-image-cropping is an app for cropping uploaded images via Django's admin backend using Jcrop. Screenshot: django-image-cr

A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.

django-versatileimagefield A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for creat

Fast batch image resizer and rotator for JPEG and PNG images.
Fast batch image resizer and rotator for JPEG and PNG images.

imgp is a command line image resizer and rotator for JPEG and PNG images.

Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like
Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like

Python Image Morpher (PIM) is a program that can take two images and blend them to whatever extent or precision that you like! It is designed to emulate some of Python's OpenCV image processing from scratch without reference.

A python program to generate ANSI art from images and videos
A python program to generate ANSI art from images and videos

ANSI Art Generator A python program that creates ASCII art (with true color support if enabled) from images and videos Dependencies The program runs u

A utility for quickly cropping large collections of images.

Crop Tool A utility for quickly cropping large collections of images. Inspired by Derrick Schultz's dataset-tools. Setup It's suggested that you use A

Optimize/Compress images using python

Image Optimization Using Python steps to run the script run the command to install the required libraries pip install -r requirements.txt create a dir

Computer art based on joining transparent images
Computer art based on joining transparent images

Computer Art There is no must in art because art is free. Introduction The following tutorial exaplains how to generate computer art based on a series

Command line utility for converting images to seamless tiles
Command line utility for converting images to seamless tiles

img2texture Command line utility for converting images to seamless tiles. The resulting tiles can be used as textures in games, compositing and 3D mod

Comments
  • Not able to watermark 'text' due to font error

    Not able to watermark 'text' due to font error

    Hi Bhaskar,

    Thank you for this python script. While I was trying to execute this; I am getting Font related error. Please see below whole python shell log:

    Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
    Type "copyright", "credits" or "license()" for more information.
    >>> 
    ========= RESTART: C:\Vivek_Personal\watermarker-master\watermark.py =========
    1. Text only
    2. Logo only
    3. Both text and logo
    choose (1 or 2 or 3) : 1
    enter water_marker text: papertreasure
    enter the text size(default=72): 50
    Transparent level(default=100): 50
    images/13891885_942077929272343_7101195289443155621_n.jpg
    (720, 960)
    
    Traceback (most recent call last):
      File "C:\Vivek_Personal\watermarker-master\watermark.py", line 53, in <module>
        font = ImageFont.truetype("Arial.ttf",txtsize)
      File "C:\Python27\lib\site-packages\PIL\ImageFont.py", line 238, in truetype
        return FreeTypeFont(font, size, index, encoding)
      File "C:\Python27\lib\site-packages\PIL\ImageFont.py", line 127, in __init__
        self.font = core.getfont(font, size, index, encoding)
    IOError: cannot open resource
    >>> 
    

    However, I was able to watermark logo successfully. Kindly help here.

    regards, Vivek Agarwal

    opened by viv1ag 2
Owner
null
Rembg is a tool to remove images background.

Rembg is a tool to remove images background.

Daniel Gatis 7.8k Jan 5, 2023
A large-scale dataset of both raw MRI measurements and clinical MRI images

fastMRI is a collaborative research project from Facebook AI Research (FAIR) and NYU Langone Health to investigate the use of AI to make MRI scans faster. NYU Langone Health has released fully anonymized knee and brain MRI datasets that can be downloaded from the fastMRI dataset page. Publications associated with the fastMRI project can be found at the end of this README.

Facebook Research 907 Jan 4, 2023
A simple programming language for manipulating images.

f-stop A simple programming language for manipulating images. Examples OPEN "image.png" AS image RESIZE image (300, 300) SAVE image "out.jpg" CLOSE im

F-Stop 6 Oct 27, 2022
A simple Streamlit Component to compare images in Streamlit apps. It integrates Knightlab's JuxtaposeJS

streamlit-image-juxtapose A simple Streamlit Component to compare images in Streamlit apps using Knightlab's JuxtaposeJS. The images are saved to the

Robin 30 Dec 31, 2022
Fixes 500+ mislabeled MURA images

In this repository, new csv files are provided that fixes 500+ mislabeled MURA x-rays for all categories. The mislabeled x-rays mainly had hardware in them. This project only fixes the false negatives for now.

Pieter Zeilstra 4 May 18, 2022
Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures.

WADs Out For [The] Ladies Simple Python / ImageMagick script to package images into WAD3s for use as GoldSrc textures. Development mostly focused on L

null 5 Apr 9, 2022
HtmlWebShot - A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features.

A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features

Danish 24 Dec 14, 2022
pix2tex: Using a ViT to convert images of equations into LaTeX code.

The goal of this project is to create a learning based system that takes an image of a math formula and returns corresponding LaTeX code.

Lukas Blecher 2.6k Dec 30, 2022
A scalable implementation of WobblyStitcher for 3D microscopy images

WobblyStitcher Introduction A scalable implementation of WobblyStitcher Dependencies $ python -m pip install numpy scikit-image Visualization ImageJ

CSE Lab, ETH Zurich 7 Jul 25, 2022
Glyphtracer is an app for converting images of letters to a font

Glyphtracer takes an image that contains pictures of several letters. It recognizes all them and lets the user tag each letter to a Unicode code point. It then converts the images to vector form and writes them to a FontForge's data format. The font can then be finalized with FontForge.

Jussi Pakkanen 38 Dec 24, 2022