Is there an easy way (ideally through the use of automatic software) to align two versions of the same frame that have different framing and/or sizes? I can't afford Photoshop, and I've never been able to figure out how to use Avisynth.
I've been trying to manually crop and resize some versions of such frames to match different versions, but I can never get them to quite line up. I need an automatic solution.
Here is an example of what I mean by two versions of the same frame (I'd like to be able to resize and crop the former one to perfectly match the latter.):
![]()
+ Reply to Thread
Results 1 to 17 of 17
-
-
"easy and automatic"??? - Not really, or not any that ensures "good" results everytime. The reason is there are many different types of cases. But the main categories are linear scaling and manipulations vs. non linear scaling or distortions/warping
Cases can be more difficult when there issues like slight warping, non linear resizing. eg. Maybe one version warped when going slightly off through a scanner, or one has lens distortion etc...). Those require photoshop or some manual control point alignment like hugin, and need to be done per scene or even more frequently
PS can (automatically) handle some types distortions, and there are manual/semi manual methods with hugin and manual control points
avisynth has an almost pure automatic with the autooverlay plugin. But it does not handle distortions . It should have worked here, but it was a bit off in your example, even though it was linear scaling (see below). It might be I didn't use the correct settings, there are many settings.
https://forum.doom9.org/showthread.php?t=175247
https://github.com/introspected/AutoOverlay
avisynth can make use of hugin with a plugin called warp . In the tutorial you can see David match the DVD and BD version of a scene.
https://forum.doom9.org/showthread.php?t=176031
https://www.youtube.com/watch?v=SG1eex7HmLM
I've been trying to manually crop and resize some versions of such frames to match different versions, but I can never get them to quite line up. I need an automatic solution.
Here is an example of what I mean by two versions of the same frame (I'd like to be able to resize and crop the former one to perfectly match the latter.):
And the example you posted is just linear scaling. From the scaling center. It's 104.7% width, 104.7% height, and you can crop and add or overlay borders if you want
In the grand scheme of things, this example is "easy". If your shots were done the same way in post, you can set one number and you're done
It's easier to do with a GUI, such as the free versions of hitfilm, resolve etc... or natron - because you can toggle on/off the layer and see if it matches and how well it is superimposed. You can easily check different parts of movie, different scenes
104.7% width, 104.7 height
[Attachment 51106 - Click to enlarge]
132px borders top and bottom
[Attachment 51107 - Click to enlarge]Last edited by poisondeathray; 15th Dec 2019 at 21:48.
-
pretty close:
Code:bg = ImageSource("a.jpg", start=0, end=23, fps=23.976) ov = ImageSource("b.jpg", start=0, end=23, fps=23.976).Crop(0,132,-0,-132).Spline36Resize(1836, 780) Overlay(bg, ov, x=42, y=150) Interleave(bg,last)
-
-
-
Here's what the result looked like. I only scaled and overlaid the smaller image. I made no attempt to adjust levels, colors, etc.
[Attachment 51109 - Click to enlarge]
Buy the way, using this script is trivial. Install AviSynth. Put the script (use Notepad to create it, specify .AVS as the extension when you save) and the two images in the same folder (I renamed them a.jpg and b.jpg when I downloaded them). Open the AVS script in an editor that supports AviSynth -- like VirtualDub2.Last edited by jagabo; 16th Dec 2019 at 12:21.
-
-
Inverting the script to do the opposite is pretty simple:
Code:bg = ImageSource("C:\Users\John\Desktop\a.jpg", start=0, end=23, fps=23.976) ov = ImageSource("C:\Users\John\Desktop\b.jpg", start=0, end=23, fps=23.976) bg.Crop(42,150,1836,780).Spline36Resize(1920,816).AddBorders(0,132,0,132) Interleave(ov,last)
Last edited by jagabo; 16th Dec 2019 at 17:54.
-
-
I think the width is a bit off in jagabo's script. A bit too skinny, horizontally compressed
This is a bit closer for avisynth, almost as close as the 104.7% . calculated the numbers for avisynth's resize using the same multiplier: 1920*1.047 = 2010.24 , 1080*1.047 = 1130.76 . But they are rounded to whole numbers (2010,1130). It has to be RGB or YUV444 because of the 1px crops, and it's rounded
Code:ImageSource("u6rvG6i6_o.jpg") b=157 spline36resize(2010,1130) crop(0,b,0,-b,true) addborders(0,b,0,b) crop(45,25,-45,-25,true)
EDIT: but it should be possible , because the avisynth resizers have src_left, src_top, src_width, src_height parameters that can take decimal values for subpixel shiftingLast edited by poisondeathray; 16th Dec 2019 at 19:46.
-
-
I made an edit above; it should be possible to get a match in avisynth similar to that 104.7 result, because of the src_left, src_top, src_width, src_height parameters can take decimal values . I don't find it "easy" to play around with those four values, it's not very intuitive for me.
For me, this sort of thing is way easier in a GUI, where you can toggle visibility easily, make changes easily. You can do a more accurate check by setting the layer mode to "difference". This makes it easier to see differences. So that will show you how to change it, eg. if you increase it by +0.1% scale for width over a certain value, but differences become larger, you are going the wrong way. You can do similar in avisynth with layer modes and avspmod and tabs (pusing the number keys can be setup like toggling visibility for that layer), or jagabo used interleave (advancing the frames will alternate versions), but changing values in avisynth is more of a pain; the feedback isn't as instant as some GUI -
-
vegas for sure, basically any NLE or compositing application. Even free versions like the ones listed above
Yes, in vegas, you can solo layer, or toggle visibility etc... change layer mode to difference or others to help align
But the scaling is slightly different in vegas . You use the Event Pan/Crop and either enter the width/height, or just drag the handles or corners in the Event Pan/Crop GUI to do it manually. The difference here is it gives the final width and height. So the values will actually be smaller. They actually work out by dividing, and it gives same results
1920 / 1.047 =~ 1833.8 width
1080 / 1.047 =~ 1031.5 height
The difference with most NLE's / compositing applications, is the project settings can be thought of sort of like a "window" that you're looking through . So if you upscale the dimensions, the layer becomes larger, but you're only "looking through" a 1920x1080 sized (or whatever project settings) window . That window only shows that view, the stuff outside isn't shown in the final render. But in avisynth, if you upscale (or downscale), the "window" becomes that same size too (until you crop or farther resize it)
But how did I figure out that 1.047? Just manually. It's not too bad when you get used to it, you toggle visibility, make adjustment, check again. Check with difference mode if you want if you have bad eyes or difficult to see differences. Rinse/repeat. Everyone has their own preferences, but for me, the easiest GUI to do these types of things is after effects. Hitfilm is like a clone of AE, and there is a free Hitfilm version . When you get the procedure down, you can tell pretty easily in a minute or so if it fall into category (A) linear or (B) non linear / warping . (B) can be terrible and a nightmare to fix properly. Lots of work
I'm not a big GIMP user, but it should be possible there too
Similar Threads
-
Free subtitles software that can align left-center dialogues
By fretta in forum SubtitleReplies: 1Last Post: 28th Nov 2019, 11:16 -
Can't align left-center subtitles
By fretta in forum SubtitleReplies: 1Last Post: 27th Nov 2019, 13:53 -
Waveform monitor in place of an oscilloscope to align a VCR?
By Brad in forum Newbie / General discussionsReplies: 23Last Post: 31st May 2017, 18:32 -
Panasonic AG-5710P (or AG-1980P) Re-Align Loading Mechanism
By pumabr in forum Capturing and VCRReplies: 2Last Post: 24th Jul 2015, 08:48 -
Avidemux: How do I align mts-files?
By MovingParts in forum EditingReplies: 5Last Post: 28th Dec 2014, 14:44