I need an Plugin for visually comparing / viewing directories of images

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

I need an Plugin for visually comparing / viewing directories of images

Post by *lbug »

Hi,
I need some tool to compare two directories with pictures (of mutually same names) in a visual way (no binary compare, no pixel comparison, no automation at all). It would be basically a viewer which does show two images side-by-side (the ones with the same name in both directories) and can be advanced by a single keystroke.

First, I did search the needed functionality for tools like IrfanView, XnView and such, because it is very cumbersome to e.g. open two IrfanView-windows to browse the two directories manually, always having to switch between both, always having to search for the next same file name if some are only contained in one of the directories, … I tried this for some hours and then threw it away, because I simply could not stand these thousands of times hitting the same keys over and over again, just to switch to the next picture.
I did not find anything for these tools, besides their functionality to compare exactly one pair of pictures, making it even more time-consuming to load the next pair - of which there could be many thousands for each task.

After this unsuccessful research I suddenly realized that all of the needed functionality is already included in TotalCommander: browsing directories for the same filenames – Synchronise directories, showing image files’ content – Lister
So I searched in the direction of TotalCommander but only found the content plugin "Image 1.10" which is not what I need. - I need a visual display of the two images, I do not need any type of mechanism to decide if the files should be considered “the same”.

Just for the motivation, there are several use cases for such a tool or plugin, e.g.
- comparing results of batch operations on images (filters, resizing, conversions, …) --- How did my holiday pictures change with this filter?,
- comparing of rendering results with different settings, tools, ... --- How does my video output, 3D-rendering or whatever change with the settings? or
- comparing of source and rendered camera views in photogrammetry --- Did the algorithm build anything comparable to my source photos?

Is there anything within the big pool of plugins which would already provide what I need?
Or does anyone know of another way to browse these image directories synchronously in an efficient manner?
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3291
Joined: 2003-05-06, 11:46 UTC

Re: Plugin for visually comparing / viewing directories of images

Post by *Sir_SiLvA »

Hoecker sie sind raus!
lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: Plugin for visually comparing / viewing directories of images

Post by *lbug »

I had not before and your download link was "down for maintenance", so I used another download source for version 1.31.
This tool does look like a common find-duplicates-helper. It would find duplicates to clean, no matter what are their file names or paths. That is not what I need and I cannot arrange such functionality to be used in the named uses cases. (I tried so with another tool, just to get lucky to see at least some of the picture pairs given by the names which were sufficiently equal to be found by the tool.)

As I stated before, I need a viewer which displays the files of same name within two directories, side by side, no matter what their content may be!
E.g., "A012345.JPG" of the first directory could show a rabbit and "A012345.JPG" of the second directory could show a carrot. The viewer should then be showing the rabbit on the left side and the carrot on the right side.
And when I hit something like [Page down] (used in many image viewers), the viewer should then show whatever content the two files of name "A012346.JPG" do contain within the two directories.

Or, to use a more realistic example, concerning the use cases I already mentioned:
In photogrammetry only the parts of a image are used to construct a model which do show the object of interest. Even in the ideal case where the model was successfully constructed and textured, the rendered camera views for testing purposes will only show the model with like a black background. All trees, bushes and other disturbances around the house ("the object", in this example) will not make it into the resulting renderings. Consequently, no find-duplicates-helper will ever find the corresponding source- and result-pictures to be showing the same content!

I really need a simple side-by-side-viewer which only shows what I have told it to be "equal" (by using the same file name).
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Plugin for visually comparing / viewing directories of images

Post by *Gral »

QUICK IDEA (may be changed and improved)

Configure user commands for 2 instances of Irfan View each occupies half of screen, e.g.

[em_irfan_1]
cmd=(pathtoirfan)\i_view32.exe /pos=(0,0)
button=(pathtoirfan)\i_view32.exe
param=/file=%P%N

[em_irfan_2]
cmd=(pathtoirfan)\i_view32.exe /pos=(800,0)
button=(pathtoirfan)\i_view32.exe
param=/file=%T%N

*(use half of your screen width instead 800)

Bind 2 user commands to one:
[em_irfan]
cmd=em_irfan_1,em_irfan_2
button=(pathtoirfan)\i_view32.exe

Assign hotkey to em_irfan

Optionally create command for close both instances of Irfan at once using "/killmesoftly"

It's possible to use internal TC viewer or any other viewer instead.
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Plugin for visually comparing / viewing directories of images

Post by *nsp »

Not a TC solution, but for me one of the best file comparison tool is p4merge. Perforce(Helix Core) Image Diff Tool do exactly what you need.
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Plugin for visually comparing / viewing directories of images

Post by *Stefan2 »

Gral wrote: 2023-08-17, 23:09 UTC QUICK IDEA (may be changed and improved)
. . . .
Nice :D



Maybe :idea::
[em_irfan_0]
cmd=(pathtoirfan)\i_view32.exe /killmesoftly
[em_irfan]
cmd=em_irfan_0,em_irfan_1,em_irfan_2
button=(pathtoirfan)\i_view32.exe

:?:



 
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *petermad »

It can be done with Lister too:

Make two new inifiles wincmd_lister1.ini and wincmd_lister2.ini with these contents:
wincmd_lister1.ini:

Code: Select all

[Configuration]
SetEncoding=äö.do.not.remove

[Lister]
Maximized=0
x=21
y=16
dx=924
dy=924
ShrinkBitmap=2
CenterBitmap=1

[ListerPlugins]
RedirectSection=wincmd.ini

[ListerPlugins64]
RedirectSection=wincmd.ini

[ListerModes]
RedirectSection=wincmd.ini

[ListerDark]
RedirectSection=wincmd.ini
wincmd_lister2.ini:

Code: Select all

[Configuration]
SetEncoding=äö.do.not.remove

[Lister]
Maximized=0
x=950
y=16
dx=936
dy=924
ShrinkBitmap=2
CenterBitmap=1

[ListerPlugins]
RedirectSection=wincmd.ini

[ListerPlugins64]
RedirectSection=wincmd.ini

[ListerModes]
RedirectSection=wincmd.ini

[ListerDark]
RedirectSection=wincmd.ini

Make these 3 commands in your usercmd.ini file (located in the same folder as your wincmd.ini file)
usercmd.ini:

Code: Select all

[em_lister1]
cmd=%COMMANDER_EXE% /i=%COMMANDER_PATH%\wincmd_lister1.ini /S=L
param=%C1

[em_lister2]
cmd=%COMMANDER_EXE% /i=%COMMANDER_PATH%\wincmd_lister2.ini /S=L
param=%C2

[em_lister1+2]
cmd=em_lister1,em_lister2
Now you can use the command em_lister1+2 in a button or a keyboard shortcut to open two selected files in two Lister windows side-by-side.

The two files are selected the same way as selecting two files for the "Compare Contents" tool - that means that the two files can be selected in the same panel or in both panels.

When running the em_lister1+2 command the first time, you can adjust the size and position of the two Lister windows and save the coordinates with Listers "Options" -> "Save position".

You can copy more Lister settings from the [Lister] section in wincmd.ini to the same sections in wincmd_lister1.ini and wincmd_lister2.ini, just don't copy the x, y, dx and dy parameters.

The two Lister windows are running as separate instances of TC, and will therefore stay open when you close TC's main window.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *lbug »

Thanks for your suggestions.

nsp wrote: 2023-08-18, 04:56 UTC Not a TC solution, but for me one of the best file comparison tool is p4merge. Perforce(Helix Core) Image Diff Tool do exactly what you need.
Frankly, I do not need a diff or merge or any other functionality apart from a simple viewer which does show image files of the same name side-by-side.
I watched the introduction video from your link and it shows (again, like every other image viewer I've checked before) complex UI-interactions (more than one keystroke!) necessary to open a single pair of images side-by-side (using drag-and-drop to compare two images). This is not efficiently usable to visually compare like 10000 image pairs per task!

I am not against drag-and-drop or using the mouse, as long as I only have to drag like the first directory to the left side and the second directory to the right side to start up the viewer. After that I want to switch to the next / previous pair using the keyboard, maybe investing half a or up to two seconds for each pair. Again: I've got to visually look through 10000 image pairs in only some minutes to find the maybe some hundred pairs with the artefacts I'm looking for, automatically skipping all missing pairs (file name only present in directory 1 or directory 2).


Gral wrote: 2023-08-17, 23:09 UTC QUICK IDEA (may be changed and improved)
[...]
Stefan2 wrote: 2023-08-18, 08:01 UTC [...]
Nice :D

Maybe :idea::
[...]
These ideas sound great for at least some special cases of the use cases I've mentioned before, using a plain viewer-solution like I am searching. I have no experience using user commands yet, so I am not sure if I got all the details correctly.

Let me try to summarize what I think I understood (of course having searched for additional information already):
You are suggesting to use TC's command browser to define own commands. But I only see commands to start IrfanView with some parameters (btw. IrfanView's annoying behaviour to move its window back to the upper left corner whenever you switch to the next picture is not that cumbersome anymore when you have more than one monitor to use, so the window position is not a big problem for me, being able to place each instance on a separate screen). 'em_irfan' is a combination of 'em_irfan_1' and 'em_irfan_2'. --- So I do know, how to start both instances with only one command. (Normally I have to hit [Enter] on both the first files of the two directories to get the two IrfanView windows.)
But how do I switch files in both of these instances synchronously?
Where should I set hotkeys to do so? In TC, in IrfanView?
How do these work? Is there a global key listener implemented somehow, so that every IrfanView instance will switch simultaneously when I hit [Space] or [Backspace] in one of these windows?

Right now, I don't really understand how I should be able to "scroll" through the image pairs to be viewed.
And even if this worked, I would have to clean the two directories before doing so, because I don't think that the two instances of IrfanView would communicate with each other to always skip to the next filename which is present in both directories. This means, I would have to copy all those GiBytes to some new location to be able to remove all single files of the two directory copies using TC's Synchronize directories, to only keep the files with equal names afterwards. Even this step is a big waste of time if I would have to do it every time I have to compare a new rendering output against the source files. (I do not own expensive TiByte-sized SSDs.)


petermad wrote: 2023-08-18, 10:29 UTC It can be done with Lister too:
[...]
Nice, to find a proposal for the Lister, too.

The Lister was one of the two places I could imagine to find a solution within TC, because the Lister can already display an arbitrary long list of image files, having them selected before and using [N] and [P] to browse them. But it lacks the synchronized switch in multiple windows concerning equal file names.
The second place, I imagined, is the Synchronize directories window which already has the functionality the find and filter files with equal names in both directories. But it only shows a tabular result. Yes, i can walk through the result using the arrow keys, but I won't see any image contents! (And yes, I know about [F3] and [Shift]+[F3] to open the Lister on each line, but this would result in even more keystrokes than I have to do switching between IrfanView windows right now.)

To come back to the given Lister-idea:
I can see how this would help to open two Lister windows side-by-side. And I use the Compare contents tool all the time, so I understand how the selections to start the Listers will work. I even find the idea of the two configurations quite appealing, because this way you can even configure those Listers to open in multimedia mode already to save the additional key stroke to [4].
But again, I missed the part where I could really browse through the rest of the directories?
As to my knowledge, the Lister can only browse through file lists I explicitly selected before. Is there a possibility to load those selections on the left and right pane of TC's main window into those two Listers?
(Also I would need an idea to create those selections of file names which do have a companion on the other pane.)
If this would be possible, I still don't understand how browsing through the Lister's file lists would be synchronised? I never got aware of an option to switch multiple Lister windows synchronously back and forth.
lbug
Junior Member
Junior Member
Posts: 24
Joined: 2015-10-08, 10:40 UTC

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *lbug »

Just to recapitulate the main idea:
I basically need a combination of Synchronize directories and the Lister!

The first part is needed to efficiently browse through the given directories, finding the image pairs according to their file names.
The second part is needed to show the images' content while browsing through the list of pairs.

I don't know if TC's predefined plugin types even allow such a new functionality? 🤔
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *petermad »

2lbug
But again, I missed the part where I could really browse through the rest of the directories?
Yes, unfortunately my solution does not cover that.

Is there a possibility to load those selections on the left and right pane of TC's main window into those two Listers?
Currently opening a new instance of Lister with the /S=L parameter only supports opening a single file.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1012
Joined: 2004-07-29, 11:00 UTC

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *ZoSTeR »

 
You could try Beyond Compare

Select two folders to compare and jump to the next different file with Ctrl+M
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *Hacker »

lbug,
I don't know if TC's predefined plugin types even allow such a new functionality?
To answer your question, no, this is currently not possible in any direct way. That's why people are suggesting workarounds which may or may not help you with your use case.
It probably wouldn't be difficult to whip up an AHK script, which enumerates one dir, and for each file checks, if it exists in the other dir, runs some image viewer with first file on one half of the screen, another instance with second file on another half of the screen, and on PageDown / PageUp closes them and goes to next / previous file pair.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
petermad
Power Member
Power Member
Posts: 14793
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *petermad »

2lbug
When I have to compare two images with small differences, I find it easier to spot those differences, if I open the two images in separate Lister windows, and then Alt+Tab back and forth between the two windows.

This solution does that by using the separate QuickView window and automatically finding the file with the same name in the opposite panel. You need to place the separate QuickView window so it doesn't cover TC's main window if possible and save it's position (Options -> Save position)

usercmd.ini:

Code: Select all

[em_SaveSelectionTarget]
cmd=cm_FocusTrg,cm_GoToFirstEntry,cm_GotoPrev,cm_SaveSelection,cm_ClearAll,cm_FocusTrg

[em_SelectItemTarget]
cmd=SELECTFILESBT
param="%N"

[em_goto_sameitem_opositepanel]
cmd=em_SaveSelectionTarget,em_SelectItemTarget,cm_FocusTrg,cm_GotoNextSelected,cm_Unselect -1,cm_RestoreSelection
menu=Go to file/folder with same name in opposite panel if it exists - preserve file selections

[em_quickview_sameitem_opositepanel]
cmd=em_goto_sameitem_opositepanel,cm_SeparateQuickView 1
button=wcmicons.dll,27
menu=QuickView file/folder with same name in opposite panel
You can make a button for em_quickview_sameitem_opositepanel, or assign it to for example Ctrl+I (by default Ctrl+I does the same as TAB)

Click on the separate QuickView window to stop the QuickView, or press Ctrl+Q.

This way you can navigate between the files in TC's file panel and click the button or press the shortcut to switch between viewing the left or right image in the QuickView window.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: I need an Plugin for visually comparing / viewing directories of images

Post by *Hacker »

lbug,
Here is an AutoHotkey script which hopefully does exactly what you want.
  1. Install the deprecated AutoHotkey v1.1 version.
  2. Save the following script as CompareSameNamedFilesInViewer.ahk and place it somewhere.

    Code: Select all

    Dir1 := SubStr(A_Args[1], 1, -1)
    Dir2 := SubStr(A_Args[2], 1, -1)
    FileMask := A_Args[3]
    Viewer := A_Args[4]
    
    Loop, Files, % Dir1 . "\" . FileMask
    	FileList .= A_LoopFileName . "`n"
    Loop, Files, % Dir2 . "\" . FileMask
    	FileList .= A_LoopFileName . "`n"
    
    Sort, FileList, CL
    
    PreviousFileName := ""
    FilesInBothDirsList := ""
    Loop, Parse, FileList, `n, `r
    {
    	If (A_LoopField = PreviousFileName)
    		FilesInBothDirsList .= A_LoopField . "`n"
    	PreviousFileName := A_LoopField
    }
    
    FilesInBothDirs := StrSplit(FilesInBothDirsList, "`n")
    Loop, % FilesInBothDirs.MaxIndex()
    	If (FilesInBothDirs[A_Index] = "")
    		FilesInBothDirs.RemoveAt(A_Index)
    
    SysGet, WorkArea, MonitorWorkArea
    SysGet, XFrame, 32
    SysGet, YFrame, 33
    ScreenWidth := WorkAreaRight - WorkAreaLeft
    ScreenHeight := WorkAreaBottom - WorkAreaTop
    
    CurrFileIndex := 1
    
    ShowFiles()
    
    PgDn::
    	If (CurrFileIndex < FilesInBothDirs.MaxIndex())
    	{
    		CurrFileIndex++
    		ShowFiles()
    	}
    Return
    
    PgUp::
    	If (CurrFileIndex > 1)
    	{
    		CurrFileIndex--
    		ShowFiles()
    	}
    Return
    
    Esc::
    	If (Viewer1PID != "")
    		WinClose, % "ahk_pid " . Viewer1PID
    
    	If (Viewer2PID != "")
    		WinClose, % "ahk_pid " . Viewer2PID
    	ExitApp
    Return
    
    ShowFiles()
    {
    	global
    
    	If (Viewer1PID != "")
    		WinClose, % "ahk_pid " . Viewer1PID
    
    	Run, % """" . Viewer . """ """ . Dir1 . "\" . FilesInBothDirs[CurrFileIndex] . """", % Dir1, , Viewer1PID
    	WinWaitActive, % "ahk_pid " . Viewer1PID
    	WinMove, % "ahk_pid " . Viewer1PID, , % 0 - XFrame + 1, 0, % ScreenWidth // 2 + 2 * XFrame + 1, % ScreenHeight + YFrame
    
    	If (Viewer2PID != "")
    		WinClose, % "ahk_pid " . Viewer2PID
    
    	Run, % """" . Viewer . """ """ . Dir2 . "\" . FilesInBothDirs[CurrFileIndex] . """", % Dir2, , Viewer2PID
    	WinWaitActive, % "ahk_pid " . Viewer2PID
    	WinMove, % "ahk_pid " . Viewer2PID, , ScreenWidth // 2 - XFrame + 1, 0, % ScreenWidth // 2 + 2 * XFrame + 1, % ScreenHeight + YFrame
    }
  3. Copy this text and paste it as a button onto your Button Bar:

    Code: Select all

    TOTALCMD#BAR#DATA
    C:\Path\To\Script\CompareSameNamedFilesInViewer.ahk
    "%P"" "%T"" *.jpg "C:\Programs\XnViewMP\xnviewmp.exe"
    C:\Program Files\AutoHotkey\AutoHotkey.exe,1
    CompareSameNamedFilesInViewer
    C:\Path\To\Script\
    
    -1
    
  4. Adjust the button to your needs, especially the file extension of the images to compare and the external viewer.
When you click the button, two windows should appear next to each other, with the same-named files from the active and target panels. PageDown moves to the next file pair, PageUp to the previous one, Escape closes the viewers and the script.

Tested on Win10.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply