Adds CLI options for finer control of input resampling #280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First off, thank you for this lovely software!
This patch adds four command-line options to the encoder tool for increased control of input preprocessing resampling:
-resample_filter X
Set resample filter kernel, default is box, filters: box, tent, bell, blackman, catmullrom, mitchell, etc.-resample_filter_scale X
Set resample filter kernel's scale, lower=sharper, higher=more blurry, default is 1.0-resample_ifgt
Only resample if the image is larger than width or height provided with -resample-resample_aspect
Keep aspect ratio of image while resampling. "fit" the image inside the -resample rectangleI've tried my best to match the style of the existing code and have of course tested all this with a bunch of different inputs.
Examples
Resample inputs using lanczos3 filter with a 0.8 scale factor:
Resample inputs to fit within 512x512, maintaining their aspect ratio:
Resample inputs only if the width is larger than 1024 or if the height is larger than 512: