Skip to content

Add a watermark to a bunch of images

The Problem: You have a bunch of images (like files in an directory ;-)) you want to add with a watermark.

The Solution (an easy one):

!/bin/sh mkdir withLogo for f in *.jpg do composite -gravity SouthEast -watermark 25% ~/path/to/my/watermark.png $f withLogo/$f done

As far as you see, this shell script creates a directory called "withLogo" and walks to every file with the ending "jpg". The script combines every file with the "~/path/to/my/watermark.png" file saves it into "withLogo".

Just change in the directoy with the images you want to add with a watermark and type in "sh path/to/my/combine/script.sh".

If the command "composite" is not on your system, try to install "imagemagick".

Translate to de es fr it pt ja

resize images via shell

The Problem: You have a bunch of images (like files in an directory ;-)) you want to resize.

The Solution (an easy one):

#!/bin/sh mkdir 800px for f in *.jpg do convert $f -verbose -resize 800 -quality 90% -comment "powered by open source" 800px/$f done

As far as you see, this shell script creates a directory called "800px" and walks to every file with the ending "jpg". The script resize every file to a with of 800 pixels and saves it into "800px".

Just change in the directoy with the images you want to resize and type in "sh path/to/my/convert/script.sh".

If the command "convert" is not on your system, try to install "imagemagick".

Translate to de es fr it pt ja