ImageMagick (command line)
To get started
Compressing
magick source.jpg -strip -interlace Plane -gaussian-blur 0.05 -quality 60% result.jpg
source
Batch processing (=> mogrify)
mogrify -quality 60 -density 72 -strip -resize 2500x1500\> -path ../foto-compressed *.jpg
In prose: This example sets the image quality to 60% and the dpi to 72, strips exif infos et al (only for png?) resizes the image if dimensions are bigger than 2500px w or 1500px heigh (keeping the aspect ratio [default]) and saving the news files at the specified (here: relative) path
Note the difference between the -densinty and the -resample option.
Combining
blend modes
-compose <blendmode>
convert img1.png imgN.png -compose multiply -composite imgOut.png
Note: whithout -composite, every layer would be outputet separately
List all blend modes with identify -list compose
Source
opacity
convert img1.png \( img2.png -alpha set -channel A -evaluate set 60% \) -composite imgOut.png
or:
convert img1.png \( img2.png -normalize +level 0,60% \) -composite imgOut.png
(not tested). Source