View Single Post
Old 10th December 2014, 21:40   #4  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,559
I designed this cropping script that works pretty well

Code:
SrcHeight = 288
SrcWidth = 352
SrcAR = 12 / 11
# Source cropping (must divide by 4)
CropLeft = 6
CropTop = 2
CropRight = 2
CropBottom = 2
# Output cropping (pixel-precision)
Crop2Left = 2
Crop2Top = 8
Crop2Right = 6
Crop2Bottom = 4
CropHeight = ((SrcHeight - CropTop - CropBottom) * 4) - Crop2Top - Crop2Bottom
CropWidth = ((SrcWidth - CropLeft - CropRight) * 4) - Crop2Left - Crop2Right
ResizeHeight = 720
ResizeWidth = Round(Float(CropWidth) * SrcAR / CropHeight * ResizeHeight / 2) * 2

Crop(CropLeft, CropTop, -CropRight, -CropBottom)
smoothD2c(12, ncpu=4)
eedi3_rpow2 (2)
nnedi3_rpow2 (2)
Spline36Resize(ResizeWidth, ResizeHeight, Crop2Left, Crop2Top, -Crop2Right, -Crop2Bottom)
Although doing cropping at the end could do the job by itself, cropping first increases performance.

Can there be any quality impact to doing resizing in such a way?

Last edited by MysteryX; 24th June 2015 at 06:28.
MysteryX is offline   Reply With Quote