Is "fit over" working?

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
giacomo.ciani
Posts: 7
Joined: Mon Mar 01, 2010 12:06 pm

Is "fit over" working?

Post by giacomo.ciani »

Hi all,

not sure if this is a bug of my misunderstanding of a function. Let's check it before moving this post to the bug section...

The "resize" function in the batch processing section has an option called "fit over". AS far as I understand, this would be equivalnet ot a "touch from outside?". In practice, if the aspect ratio of the original image is different from that of the requested target size, and assuming that you want to keep the aspect ratio, there are two way of resizing:
- without "fit over": you make the image entirely fit in the target size; one of the two dimensions (H or W) will be smaller than the requested size.
- with "fit over": you make the image completely fill the requested size, leaving some extra if needed on one of the two dimensions (H or W).

I've been trying this with a square image, 500x500 pixel, requesting a target size of 300x200 (HxW). These the settings and the results:
- keep aspect ratio checked, fit over unchecked, follow orientation unchecked. Final image: 200x200 (AS EXPECTED)
- keep aspect ratio checked, fit over CHECKED, follow orientation unchecked. Final image: 200x200 (UNEXPECTED!)

So, the option seems to make no difference. Can anyone check on this?

I'm using XnView 1.97.8 with Libformat 5.76 on a Windows 7 64-bit machine.

Thanks

Giacomo
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Is "fit over" working?

Post by marsh »

I remember 'fit over' using short side. The terminology changes in XnConvert (longest/shortest side and a very nice preview of actions).
- scaling to the shorter side
giacomo.ciani
Posts: 7
Joined: Mon Mar 01, 2010 12:06 pm

Re: Is "fit over" working?

Post by giacomo.ciani »

I remember 'fit over' using short side. The terminology changes in XnConvert (longest/shortest side and a very nice preview of actions).
I just installed and tried it, but I don't think it does what I want...
- scaling to the shorter side
Ok, I think this post got the point... let's clarify what I want to get:
- Forget for a moment the orientation, and suppose I have only landscape pictures.
- Let's also suppose the have all different aspect ratios
- I don't want to distort the pictures
- I want to resize them so that they have the exact resolution of my monitor, let's say 2000x1000
- I'm ok with trimming away part of the picture, but I don't want black (or any other color) bands around it

Now:
- I can't use normal resize to 2000x1000, as a picture that is 3000x3000 will end up being 1000x1000 (black bands on the sides)
- I can't use "resize shortest side" to 1000, as a picture that is 3000x2000 will end up being 1500x1000 (black bands on the sides)
- I can't use "resize longest side" to 2000, as a picture that is 4000x1000 will end up being 2000x500 (black bands top and bottom)

I was hoping that the meaning of "fit over" was that of making sure that one of the sides (which one depending on the original and target aspect ratio) of the image would match the target size, with the other one being longer so that it can be trimmed later. In practive, the image has to "fill"the target size with the minimum amount of trimming.

Indeed, this is how "fit over" works if you set a square size as a target. For example, setting 1000x1000 as a target size you obtain:
4000x1000 -> 1000x250 without fit over (black bands everywhere on a 2000x1000 screen)
4000x1000 -> 4000x1000 with fit over (ok)

BUT:

5000x4000 -> 1000x800 without fit over (black bands everywhere)
5000x4000 -> 1250x1000 with fit over (black bands left and right)

You can convince yourself that it doesn't work with 2000x2000 either.

In addition, if you set a non-square size, "fit over" doesn't seem to make a difference anymore... I tried resizing a 500x500 image to 300x200, and I was expecting to obtain 200x200 without fit over, and 300x300 with fit over, but I got 200x200 in both cases.

I'm confused...

Giacomo
User avatar
xnview
Author of XnView
Posts: 46238
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Is "fit over" working?

Post by xnview »

Ok, so what you would like is something like resize & crop, right?
Pierre.
giacomo.ciani
Posts: 7
Joined: Mon Mar 01, 2010 12:06 pm

Re: Is "fit over" working?

Post by giacomo.ciani »

Hi! Thanks for joining the conversation.
Ok, so what you would like is something like resize & crop, right?
No, not necessarily. Although "resize&crop" is my final target, I don't really need a specific command for that (and in fact I think it's better and more flexible to keep the two operation separated). It's very easy to accomplish in two steps, PROVIDED that the resize function can do what I tried to explain in the previous post (and what I thought it would do using "fit over").

In fact, I still don't understand what is the supposed behavior of "fit over", and I couldn't find any documentation on that. I'll be happy if you could explain me what is the intended result of that option...

Since I'm still not sure that I was clear in explaining what I expected "fit over" to do, I'll try again (sorry for the repetition...):

The resize option I try to explain is very common in video players. As you often have video that have a different aspect ratio wrt the screen (and assuming you don't want to distort the image), you have basically two ways of resizing the video:
- one is fitting the entire video inside the screen, so that you can see all of if, but with additional black bands to adjust for the aspect ratio.
- the other one is "fitting the screen inside the video", that means, the screen area is completely filled by the video, and some portion of the video is not shown as it "overflows"

Another way of seeing it is imagine that the image is a blue box, and the "requested size" is a red one. After the resize operation:
- in the first case the blue box will be contained in the red one, with one side (which one depends on the relative aspect ratio) exactly matching the corresponding red one, and the other side shorter than the corresponding red one.
- in the second case, the situation is inverted: the blue box CONTAINS the red one, with one side (again dependent of aspect ratio) as long as the red one, and the other longer than the corresponding red.

Now, the first case is what XnView does by default (provided "keep aspect ratio" is checked), except that it does not add black bands, but simply leaves one dimension shorter than the requested size (and that's OK)
The second option (but without cropping) is what I need, what I expected "fit over" to do, and what IT INDEED DOES, but ONLY when you set a square target dimension.

Sorry for the length. Hope it's clear now...

Giacomo
Post Reply