As Magic Banana pointed out, G'MIC might be a good idea to try, also,
ImageMagic is also a great tool for the job.
Note 1: The example given in the end of this comment will replace the
existing images, so make sure to have backups. I could make a more
elaborated example, at the cost of losing easy understanding.
Note 2: My copy of ImageMagick came from Guix package manager, not from
Trisquel 7's repositories, so there might be differences in the
result. Specially because I was forced to upgrade my ImageMagick because
I needed to work with .jpg images which had embeded color profiles.
Note 3: Please replace the lines starting with "/home/adfeno" to the
full/absolute path to the images that you want to edit. This can be done
by selecting all of then in file manager (default for Trisquel is
Nautilus), copying them, pasting in a text editor, and this should give
the paths you want to copy again and paste in the area I just described.
I'll first describe what the `convert` command options do, and then I'll
give you the actual script.
Description:
`-auto-orient` attempts to read EXIF orientation tag from the image
file, and respects it. The resulting image will not have such EXIF tag,
but will still be corrected. This avoids having images in the wrong
orientation.
`-colorspace "Gray"` converts from the image's color space to a generic
grayscale color space. Note that, if the input image depends on a more
complex color space (like the CMYK madness, for which even conversion
between the exact CMYK profile results in distortion), and if you want
the resulting image to use RGB color (the color used by the
monitor/display you are using to read this now), you must place
`-profile [Path to desired RGB color profile file]` before `-colorspace`
line. For the sake of completeness, in the case of Trisquel 7, the path
for the color profile of your current monitor/display can be obtained
using the following command:
$ colormgr get-devices-by-kind "display"
And to check if the images have embeded color profiles (and which color
space/standard they represent), use:
$ identify -verbose "[Path to image file]"
To find the color space, look for the topmost "Colorspace" line. To find
out if the color profiles are embeded, look for the topmost "Profiles"
line (this line has others inside). If the color space is CMYK, then the
profiles *must* exist, otherwise the photocopy effect might produce
non-grayscale or bad results.
Now, continuing with the main explaination:
`+clone` clones the last generated image (the one resuting from setting
the image as grayscale only) to the set of current operations (which are
limited between "\(" and "\)").
`-blur "0x2"` blurs the image slightly. Particularly, I find this value
to produce a result more closer to a photocopy than the one produced by
the values suggested by my copy of GIMP.
`+swap` swaps the the last two images in the sequence (this should put
the grayscale image behind the original one).
`-compose "DivideDst"` uses the mathematical compose method called
"DivideDst" which is, like all mathematical compose methods, greyscale,
and simply attempts to divide the uppermost image in the sequence by the
previous image in the sequence. This means, for example, that: If the
grayscale (previous image) has a color understood to be similar to zero,
that part of the uppoermost image is ignored. With older versions of
ImageMagick, the "DivideDst" is called "divide".
`-composite` actually generates the image that resulted from all
operations so far. This makes a new image available in the sequence.
`-linear-stretch "5%x0%"` does some color stretches. Particularly, I
find this value to produce a result more closer to a photocopy than the
one produced by the values suggested by my copy of GIMP.
`-scale [Geometry]` scales the topmost image (no enclosing "\(" or
"\)") but *keeps* aspect ratio (avoids "fat" or "tin" effects on
images). If you do want to force the geometry of 1000x1333, then use
"1000x1333!" instead (notice the exclamation mark).
Actual script:
while read -r each_original_image; do
convert "$each_original_image" \
-auto-orient \
-colorspace "Gray" \
\( +clone -blur "0x2" \) \
+swap \
-compose "DivideDst" \
-composite \
-linear-stretch "5%x0%" \
-scale "1000x1333" \
"${each_original_image}"
done <<ORIGINAL_IMAGE_LIST
/home/adfeno/Images/Example 1.jpg
/home/adfeno/Images/Example 2.jpg
/home/adfeno/Images/Example 3.jpg
ORIGINAL_IMAGE_LIST