Compare Photos with ImageMagick and a KDE Service Menu Action

Need to compare two photos side-by-side? Using the convert tool, you can quickly stitch two or more photos together and compare the result in any image viewer:

convert photo1.jpg photo2.jpg +append compare.jpg

The example command above stitches photo1.jpg and photo2.jpg from left to right (i.e. photo1.jpg + photo2.jpg), but you can use -append instead of +append to reverse the order (i.e. photo2.jpg + photo1.jpg). In both cases, the stitched image is saved under the compare.jpg name.

If you use KDE as your preferred graphical desktop environment, you can create a context action to stitch file pairs in the Dolphin file manager. Create a text file and paste the following code into it:

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=image/JPG;image/JPEG;image/jpeg;image/JPG;image/jpg;
Actions=Compare
[Desktop Action Compare]
Name=Compare Photos
Exec=convert %F +append compare.jpg
Icon=image-x-applix-graphics

Save the file under the compare.desktop name and move it to /usr/share/kservices5/ServiceMenus:

sudo cp compare.desktop /usr/share/kservices5/ServiceMenus/

Open Dolphin, select a pair of JPEG files you want to compare, right-click on the selection, and choose the Actions → Compare Photos action to resize the image. This generates a compare.jpg file with the selected photos side by side. You can then use your preferred image viewer to examine the photos.

This is an excerpt from the Linux Photography book. Get your copy here.

Tech writer covering Linux and open source software

Tagged with: , ,
Posted in Open Source, Photography, Scribbles, Software
2 comments on “Compare Photos with ImageMagick and a KDE Service Menu Action
  1. Dmitri,
    Hello.
    Thank you this is a superb Linux-ista tool!
    matthew

  2. D. Manny says:

    This is a great tip. Very hand for KDE users like myself.

Comments are closed.

Recipes for automated and streamlined photographic workflow on Linux

Curve presets for digiKam and the GIMP

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: