3

I have to compare lots of images (gif format) manually to each other. In order to do that I do the following steps:

  1. I open one image with the ubuntu image viewer
  2. I semi maximize the window to one side of the screen
  3. I do the same thing with the image I want to compare it to only putting it on the other side of the screen, of course

Since I need to do this for a lot of images I am wondering if there is an easier way to do this. Maybe another program?

The images I am comparing are located in different folders but have the same name. The folders contain multiple images, so it would be great to have the opportunity to select the next image from both folders.

Do you have any ideas how I could do this?

9
  • Well, I could automate opening image viewer and placing them left and right, like ./snap-images.sh /path/to/img1.gif /path/to/img2.gif It's relatively simple. What's your requirements though ? Also, can you clarify this part: would be great to have the opportunity to select the next image from both folders. How exactly do you want this behavior to be ? Jan 9, 2017 at 12:07
  • Well, this is the tricky part I guess. If I open one image with the image viewer there is a button to show the next image in the folder. I would like that for both images from the different folders the next image is automatically shown if I click the button once.
    – Ole
    Jan 9, 2017 at 12:39
  • Hi Ole, are the images, to be compared, similar by definition? Jan 9, 2017 at 12:46
  • I don't know if I understand you correctly. The pictures show the same plots (for quality assurance of experimental data) filled always with slightly different information, of course. So I think the answer is yes.
    – Ole
    Jan 9, 2017 at 12:50
  • "The images I am comparing are located in different folders but have the same name" I bet it could scan ALL of them and put them all side by side under each other ;-)
    – Rinzwind
    Jan 9, 2017 at 12:50

1 Answer 1

5

You could build your script from this one:

#!/bin/bash

if [ $# -ne 2 ]
then
 zenity --info --text="Usage: $0 file1 file2"  2> /dev/null
 exit
fi

feh -g 950x800+5+30 "$1" & pid1=$!
feh -g 950x800+963+30 "$2" & pid2=$!

# using xterm as a workaround to raise zenity to the top (so that is is not behind the feh windows)
#xterm -geometry 40x3-0-0 -e zenity --title="Done?" --info --text="OK or Enter when done"; 2> /dev/null 

xterm -title "${0##*/}" -geometry 70x4+750+880 -e bash -c "read -p 'Press Enter when done'"

kill $pid1 $pid2

Add an outer loop that will guide you through the pairs of images that you want to compare. And of course, you can modify the geometry of the feh windows to match your image files and monitor resolution (this was made for a 1920x1080 monitor). And you can modify and move the control window (the xterm window).

5
  • Thank you very much for this answer! I have added an outer loop and adjusted the window size to my screen. I am having trouble now only with zenity, because it appears always in the center of my screen and is blocking the view. Can I adjust the geometry of the notification box in some way similar to the xterm? edit: another option would be to request user input in the current terminal but than I have the problem that the terminal is not on top anymore. Would there be another workaround to fix this?
    – Ole
    Jan 9, 2017 at 14:58
  • What desktop environment are you using? I am testing in LXDE (of Lubuntu), but I might be able to check in Unity of standard Ubuntu or whatever you are using (if an Ubuntu flavour). If you use some exotic desktop environment, I think you should fix the position and focus of the control window yourself. - Anyway, I selected a simple xterm, positioned below the feh windows, and it works in my desktop environment. (See the edited answer.)
    – sudodus
    Jan 9, 2017 at 17:05
  • I am using the standard unity. But now with your edited answer it works perfect for me. This is exactly what I wanted :) Thanks again!
    – Ole
    Jan 10, 2017 at 8:45
  • You are welcome, I'm glad it works for you :-)
    – sudodus
    Jan 10, 2017 at 11:13
  • 1
    If you want the zenity dialog to show above other windows, you can set WINDOWID to an empty value, eg. export WINDOWID= (you don't need the xterm workaround for it).
    – NeoH4x0r
    Feb 26 at 21:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .