Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th December 2017, 05:49   #1  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,683
CropResize script

My new cropping/resizing script. If anyone tries it and finds a problem, please let me know.
The idea is to be able to crop and resize without having to calculate aspect error, as the script will automatically crop as required to prevent the picture from being distorted. It uses an Avisynth resizer to apply sub-pixel cropping.

CropResize 2018-01-12.zip
New version. Only one very minor change. See post #3 for details.
CropResize 2018-02-15.zip
New version due to changes to the cropping preview. See post #4 for details.
CropResize 2018-03-17.zip

There's a few dependencies if you want to enable auto-cropping or colour correction, or specify the resizing method. There's links in the help file but the script can be used without them.

Edit 2018-01-13: Removed old screenshot and updated the link.

Last edited by hello_hello; 17th March 2018 at 01:26.
hello_hello is offline   Reply With Quote
Old 13th January 2018, 05:59   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,683
I've ironed out some minor gremlins and hopefully the script's at the "final" stage.

The main change since the initial version is the addition of a GUI-like cropping preview. I missed having one as it makes fine tuning the cropping easier. The cropping preview can be enabled simply by adding "P" to the beginning of the function name (or when using any of the wrapper functions).

The script has non-resizing modes and it can also add borders etc, but the following screenshots are examples of normal resizing mode with substantial cropping applied to help demonstrate. The equivalent of:

Crop(30, 4, -24, -4)
Spline36Resize(640, 480)
only without the need to worry about any aspect error.

A 4:3 PAL DVD Source:





The cropping preview - CPreview.
The yellow lines show the manual (specified) cropping, while the light blue lines show any additional cropping applied by the script to prevent any aspect error when resizing (rounded to the nearest whole pixel for the preview).
An input pixel aspect ratio or display aspect ratio must be specified for anamorphic sources.

pCropResize(640, 480, 30, 4, -24, -4, InDAR=15.0/11.0)
or
CropResize(640, 480, 30, 4, -24, -4, InDAR=15.0/11.0, CPreview=true)





The old cropping preview - CPreviewB.
The transparent yellow borders show the manual (specified) cropping, while the blue borders show any additional cropping applied by the script.

CropResize(640, 480, 30, 4, -24, -4, InDAR=15.0/11.0, CPreviewB=true)





The same cropping and resizing as above, only with the cropping preview disabled and Info=true.
CropResize(640, 480, 30, 4, -24, -4, InDAR=15.0/11.0, Info=true)





If you don't want a particular aspect ratio or resolution, you can simply specify a width (or height) and let the script take care of the rest. The script will resize to the appropriate height (or width) while cropping a little picture if need be to prevent any aspect error.

This time only specifying a width of 640, but due to the amount of cropping and the Aspect option being enabled, the script still resized the height to 480 anyway.

CropResize(640, 0, 30, 4, -24, -4, InDAR=15.0/11.0)


Last edited by hello_hello; 17th March 2018 at 16:59.
hello_hello is offline   Reply With Quote
Old 15th February 2018, 02:37   #3  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,683
One very minor change to the script effecting the cropping preview. As well as displaying the source resolution and cropping it now also displays the eventual output picture resolution.
It makes using the preview a little easier, as for example, when specifying only a width and letting the script take care of the height, you don't have to disable the cropping preview to determine what the final output resolution will be.

The new version is dated 2018-02-15. There's a link in the opening post.

Last edited by hello_hello; 17th March 2018 at 01:58.
hello_hello is offline   Reply With Quote
Old 17th March 2018, 01:39   #4  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 3,683
I made some changes to the cropping preview and there's a link to the new version of the script dated 2018-03-17 in the opening post.

- The text is now easier to read.
- The preview options previously named MCPreview and TCPreview are gone. In hindsight, a preview displaying only the manually applied cropping doesn't seem very useful.
- The default cropping preview option is now called CPreview. It only overlays lines to preview the cropping rather than coloured borders. It makes it easier to see what you're cropping as the area being cropped isn't coloured.
- The old cropping preview showing coloured borders is renamed CPreviewB. If you prefer the old preview and want to make it the default (when prefixing the function name with "p"), there's instructions in the help file.
- A new option called CLine sets the width of the lines overlayed on the video by CPreview.

The screenshots in post #2 have been updated to show the new cropping preview.

Last edited by hello_hello; 17th March 2018 at 02:25.
hello_hello is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.