Show viewing offset in image information

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

User avatar
m.Th.
XnThusiast
Posts: 1600
Joined: Wed Aug 16, 2006 6:31 am

Re: Show viewing offset in image information

Post by m.Th. »

oops66 wrote:Hello Xntriq,
... Thank you ... I like your last solution to compare two images ;-)
... the Before/After plugin:
http://www.catchmyfame.com/catchmyfame- ... er-plugin/
Well then...

This is more easier to implement than one thinks - at least till a more-than-usable level:

1. Add splitters between the views in the Compare window (or if is easier for Pierre to work with headers, I have no problem)
2. Add a "Before/After" check box. (The caption text for this checkbox is subject to change)

Something like this (screenshot presented for 3 images - the same applies for 2 or 4 images):
Compare-Splitters.jpg
If the check box is unchecked the splitters will work normally - thing which, by itself, is a good feature.

If the check box is checked then in the splitterMoved signal, find the distance on which the splitter was moved and substract it from the offset of the image from the view on the right part of the splitter in order to give the effect that the image from the right "stays" on screen.

I think that this "Before/After" feature together with "Use tabs" will enhance a lot the comparing experience without too much coding from Pierre's part.
You do not have the required permissions to view the files attached to this post.
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Show viewing offset in image information

Post by oops66 »

m.Th. wrote:...I think that this "Before/After" feature together with "Use tabs" will enhance a lot the comparing experience without too much coding from Pierre's part.
... Me too ;-) (good idea for a optional "before/after" (and/or XOR) extra window (or extra tab ?) to compare some "very similar pictures" )
XnViewMP Linux X64 - Debian - X64
CameronD
Posts: 308
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: Show viewing offset in image information

Post by CameronD »

XOR is useful for some purposes, but can give very distorted results.
Two examples - starting with a value of 0x7f (mid brightness on an 8-bit scale):
  • subtract 1 and XOR - the result is 1
  • add 1 and XOR - the result is 0xff
A more quantitative visual representation of differences is the absolute value of the pixel differences.
This can then be scaled by multiplication of a value generally between 10 to 50 to get an image with good visual clues.
An even better scaling parameter would be to use the image luminance as a scale factor, and apply maximum scaling to mid-tones, decreasing as they get closer to 0 or 0xff.

To experiment with this sort of stuff, I use ImageJ, which has a wide range of mathematical image manipulation functions.
User avatar
xnview
Author of XnView
Posts: 37892
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Show viewing offset in image information

Post by xnview »

Ok, for "Use tabs"
m.Th. wrote: I think that this "Before/After" feature together with "Use tabs" will enhance a lot the comparing experience without too much coding from Pierre's part.
I don't understand the 'Before/After' option...
Pierre.
User avatar
m.Th.
XnThusiast
Posts: 1600
Joined: Wed Aug 16, 2006 6:31 am

Re: Show viewing offset in image information

Post by m.Th. »

xnview wrote:Ok, for "Use tabs"
m.Th. wrote: I think that this "Before/After" feature together with "Use tabs" will enhance a lot the comparing experience without too much coding from Pierre's part.
I don't understand the 'Before/After' option...
Yeah, ok. Let me explain what the guys want (and I subscribe too).

First, to explain what we have:

We have a Compare window in which we can see side by side the photos img1, img2, img3 and img4 in order to choose the best one.

Ok, this is all fine. Now, let's add a small enhancement: a vertical splitter between each two views. Yeah, this is nice sometimes - one wants to see more from a photo or from another.

But what happens with a splitter?

Because the photos has the LeftX and the TopY coordinates static when the user move the splitter the 2nd image 'slides' with the splitter - it is the normal effect everywhere.

However, in most of the cases (usually) the img1 and img2 have a strong connection between them:

- the img1 is the image BEFORE processing and img2 is the image AFTER processing

AND/OR

- the img1 and the img2 are consecutive images from a series of shots (burst or not) of the same subject.

For both very common scenarios from above the splitter should optionally behave like this:

http://www.catchmyfame.com/catchmyfame- ... er-plugin/

(move the splitter in the middle of photos to see the effect)

In fact the only code needed is the one which will make the second photo 'static' - IOW substract from the 2nd photo's LeftX the SplitterX distance on which splitter is moved (distance positive to right, negative to left). In fact at the link above there is the source code in JavaScript on how to do it. As always, the programmer needs to be attentive at bounds, margins etc. :)
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
xnview
Author of XnView
Posts: 37892
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Show viewing offset in image information

Post by xnview »

m.Th. wrote: For both very common scenarios from above the splitter should optionally behave like this:

http://www.catchmyfame.com/catchmyfame- ... er-plugin/

(move the splitter in the middle of photos to see the effect)

In fact the only code needed is the one which will make the second photo 'static' - IOW substract from the 2nd photo's LeftX the SplitterX distance on which splitter is moved (distance positive to right, negative to left). In fact at the link above there is the source code in JavaScript on how to do it. As always, the programmer needs to be attentive at bounds, margins etc. :)
ok, for 2 images, but for 3 or 4??
Pierre.
User avatar
m.Th.
XnThusiast
Posts: 1600
Joined: Wed Aug 16, 2006 6:31 am

Re: Show viewing offset in image information

Post by m.Th. »

xnview wrote:
m.Th. wrote: For both very common scenarios from above the splitter should optionally behave like this:

http://www.catchmyfame.com/catchmyfame- ... er-plugin/

(move the splitter in the middle of photos to see the effect)

In fact the only code needed is the one which will make the second photo 'static' - IOW substract from the 2nd photo's LeftX the SplitterX distance on which splitter is moved (distance positive to right, negative to left). In fact at the link above there is the source code in JavaScript on how to do it. As always, the programmer needs to be attentive at bounds, margins etc. :)
ok, for 2 images, but for 3 or 4??
Pierre, it's a tool. For us.

Is not a critical exam in order to see that you can cover all the situations. :)

Let's define x1, x2, x3, x4 the left coordinates of each photo. In the same way, let's have the y1, y2, y3, y4 for top coordinates.

Also, let's define the d1, d2, d3, d4 the moving distances (if exist) for each splitter (if exist).

Let's start with the simple, known case:

What do we must add for 2 photos?

In the splitter's AfterMove signal (or in a similar place) we must 'simulate' that the next photo (img2) is staying. Hence: x2 := x2-d1; That's all.

In the case of 3 photos what we have?

If the 1st vertical splitter is moving we must 'simulate' that the next photo (img2) is staying. Hence: x2 := x2-d1;
If the 2st vertical splitter is moving we must 'simulate' that the next photo (img3) is staying. Hence: x3 := x3-d2;

The key word here is "next" - you must act only on the 'next' photo: the "next" photo is the photo at the right of the splitter.

In the case of 4 photos:

Let's say that we have the images like this:

Code: Select all

img1 | img2
-----+-------
img3 | img4

You have some paths:

1. I would put in the form/tab only 2 (two) vertical splitters and one horizontal splitter. The vertical splitters will work like above (one on the img2: x2 := x2 - d2; and one on img4: x4 := x4 - d4). The horizontal one will be a 'classical' one, no code required.

2. Again, 2 vertical splitters and one horizontal splitter. The vertical splitters work like above. The horizontal splitter will work on BOTH images at bottom: y3 := y3 - d3; AND y4 := y4 - d3; (d3 in both formulas since we have a single horizontal splitter)

3. Implement a quad splitter, like this one: https://qt-project.org/forums/viewthread/7308

The formulas will be the same. The quad splitter acts on img2, img3 and img4:

x2 := x2 - d2; x4 := x4 - d2; (the horizontal distance is the same for both photos)
y3 := y3 - d3; y4 := y4 - d3; (the vertical distance is the same for both photos)
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Show viewing offset in image information

Post by oops66 »

xnview wrote:....
ok, for 2 images, but for 3 or 4??
... Right, this tool is especially (and only) useful to compare 2 per 2 images ... because it's the goal in this precise case (like the XOR filter).
XnViewMP Linux X64 - Debian - X64
User avatar
m.Th.
XnThusiast
Posts: 1600
Joined: Wed Aug 16, 2006 6:31 am

Re: Show viewing offset in image information

Post by m.Th. »

oops66 wrote:
xnview wrote:....
ok, for 2 images, but for 3 or 4??
... Right, this tool is especially (and only) useful to compare 2 per 2 images ... because it's the goal in this precise case (like the XOR filter).
If you read closer my latest post, you'll see that I didn't speak about the XOR - I just answered about his question (comparing with 'before/after') I gave simple ways/formulas to do it between the two adjacent images even in 3 and 4 layouts. For example, I didn't spoke about comparing 3 images but about interaction between img1 with img2 and img2 with img3.
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Show viewing offset in image information

Post by oops66 »

... Yes I know, but basically, either than "XOR filter" or 'before/after plugin' , they compare the images 2 per 2 ... no ? ;-)
....I didn't spoke about comparing 3 images but about interaction between img1 with img2 and img2 with img3.
... Ok ... or an other way is to have the ability to have(select) one image file for reference, and the others (to select) to compare with the reference one.
XnViewMP Linux X64 - Debian - X64
User avatar
m.Th.
XnThusiast
Posts: 1600
Joined: Wed Aug 16, 2006 6:31 am

Re: Show viewing offset in image information

Post by m.Th. »

, either than "XOR filter" or 'before/after plugin' , they compare the images 2 per 2 ... no ?
Yes, Sure. It is too complicated from user point of view to XOR 3 (or more) images together. The result will show... ...what? It is only useful to show if ALL three images are the same. But for this corner case, there are simpler approaches.

'Before/After' by its very design (a splitter which shows dynamically more or less from two images) a comparison between two adjacent images. We can implement 'Before/After' with 5,6,7,8...,10,12 etc. images. Always 'Before/After' will work only between two adjacent images.
m. Th.

- Dark Themed XnViewMP 1.0 64bit on Win10 x64 -
User avatar
oops66
XnThusiast
Posts: 2005
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Re: Show viewing offset in image information

Post by oops66 »

... Yes, why not ... it's a good idea.
XnViewMP Linux X64 - Debian - X64
User avatar
xnview
Author of XnView
Posts: 37892
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Show viewing offset in image information

Post by xnview »

m.Th. wrote: Pierre, it's a tool. For us.
yes :) but here we can't use QSplitter, i need to re think compare dialog...
But in your example, you have only ONE view, and not 2 (3 or 4), the splitter is in the view. I don't understand how to do that with current compare dialog...
Pierre.
Phred
Posts: 37
Joined: Fri Nov 06, 2009 3:48 pm

Re: Show viewing offset in image information

Post by Phred »

m.Th. wrote:
yossic00 wrote:Hi,
-snip-
Thanks,
Yossi
About "open images from different directories" - you can do that by eg. using Tag box.
[emphasis/colour added]


About the other thing: you said that "it's easier to spot differences when comparing images by alternating between them" - why that? Do you want to see where the images are different? Perhaps a XOR overlay engine which will show only the differences between files will help?
In vn. 2.30 we seem to have lost that capability - to tag between directories.
Moving to, for example, another local directory in Favourites, loses the first tag.

PhredE
23rd Feb 2015