The first instance of CropResize resizes to 704x480 with a 16:9 display aspect ratio, adding top and bottom borders. Specifying an output display aspect ratio and adding bordersĬropping and resizing to NTSC dimensions, with an mpeg4 display aspect ratio of 20:11 and 8 pixel borders each side. MeGUI was used to crop the source, adding it's global DAR variables and cropping to the script.ĬropResize then takes care of the resizing and any extra cropping required to prevent aspect error. As for the previous example, 4:3 output dimensions are specified.ĬropResize(704,528, 10,12,-8,-12, InDAR=20.0/11.0, Borders=true, Info=true) When specifying both an output width and height, and borders are enabled, the script adds pillarbox or letterboxīorders as required instead of cropping picture (a small amount of extra cropping may still be applied to preventĪspect error). Simply to demonstrate, here 4:3 output dimensions are specified.ĬropResize(704,528, 10,12,-8,-12, InDAR=20.0/11.0, Info=true)Īdding borders according to the output dimensions When specifying both an output width and height, and borders aren't enabled, the script crops accordingly to preventĪspect error (although specifying an OutDAR takes precedence over the cropping and output display aspect ratio). The abbreviated function name CR() can be used instead of CropResize() if the wrapper functions script is loaded.ĬropResize(832,0, 10,12,-8,-12, InDAR=20.0/11.0, Info=true)ĬR(832,0, 10,12,-8,-12, InDAR=20.0/11.0, Info=true)Ĭropping according to the output dimensions Simply specify a width (or height) and the desired cropping (or enable auto-cropping), along with the input displayĪspect ratio if the source is anamorphic, and let CropResize take care of the rest, here resizing to "square pixel" dimensions. The (home made) PAL 16:9 source (with an mpeg4 20:11 display aspect ratio) used for the following examples
Some of these examples also demonstrate using the wrapper functions supplied with CropResize to easilyĮnable the default cropping preview or set Info=true, and some also use the abbreviated function name of CR().
The easiest way to demonstrate CropResize is with some pictures See this post for an additional function that integrates CropResize into MeGUI a little (not required to use CropResize). This is labelled version 6 as it's been updated to match the functionality of CropResize above,īut it supports the original color conversion methods (ColorMatrix and DitherTools). The last version to support ColorMatrix and DitherTools for color conversion (updated to version 6)
The pictures in post #2 illustrate CropResize usage It can apply sub-pixel cropping when required.ĭespite the numerous options, basic usage is fairly straightforward. Rather than distort the picture as traditional resizing does when the input and output aspect ratios don't match, the script crops or adds borders instead. The main goal of CropResize is to crop and resize without having to worry about calculating aspect error or distorting the picture.