Improve quality of your photos, in batches
Image magick is an excellent command-line photo editor, it has a lot of features other image editors have, but because of its command-line nature, it can perform them on multiple images at a time.
I had a couple of basic image-improving changes to be performed on 5 of my photos. All of my photos have name of ‘IMG_*.jpg’. I put the processed photos into a separate folder just not to mix them up, folder is called
convert ./IMG_*.jpg -level 25%,75%,2.0 ./conv/img.jpg
convertis a utility made for converting images, it’s part of the imagemagick.
./IMG_*.jpgis a regular expression for the input files.
-levelis imagemagick’s option that tells us that we want to change the image’s levels (brighness, contrast, …).
black point. white point means “take all pixels that are equal to this value or lighter and make them completely white”, and black point means “take all pixels that are equal to this value or darker and make them completely black”. This will increase contrast and brightness of the image.
gamma, it’s for making the image lighter or darker in general, see more here.
./conv/img.jpgis the name of the resulting image. We’ll get a bunch of images with the names
img_1.jpgin the folder
See more on image levels here.
convert ./IMG_*.jpg -crop 1330x1100+320+0 ./conv/img.png
convert- as we already know is the name of the converting utility.
./IMG_*.jpgare the names on the input files
-cropis the name of the option
1330x1100- is the requested size of the cropped image.
+320+0- is the center of the crop.
See more on crop here.