AWS Thinkbox Discussion Forums

Image.Resize not working

Hello,

I’m trying to create a draft template to create a side-by-side stereo mov from a left eye and a right eye image sequence but it’s not working.

I create an image with the full width and height (e.g. 1920x1080):

bg = Draft.Image.CreateImage(1920, 1080)

I then read in the images:

left_frame = Draft.Image.ReadFromFile (left_file) right_frame = Draft.Image.ReadFromFile (right_file)

I then resize the images:

left_frame.Resize(960, 1080) right_frame.Resize(960, 1080)

Finally I composite the images together:

compOp = Draft.CompositeOperator.OverCompositeOp bg.CompositeWithAnchor(left_frame, Draft.Anchor.West, compOp) bg.CompositeWithAnchor(right_frame, Draft.Anchor.East, compOp)

What I end up with is a movie with a resolution of 1920x1080 with the left and right frame composited in the correct places (left and right). The problem is the left and right images are now 960x540, not 960x1080 as requested and sit in the middle of the image with black bars top and bottom. It seems the Resize function is resizing proportionally based on the width but I need the frames to be squashed for side-by-side stereo.

Hi there!

Here are good news… I believe what you need to do is to choose the way you want Draft to resize your image by adding an optional parameter to your Resize() function call. Valid values are: ‘none’, ‘width’, ‘height’, ‘fit’, ‘fill’ and ‘distort’. You can find a description of each one here: docs.thinkboxsoftware.com/produc … Image.html under the Resize() function. Note that the default is ‘fit’.

Please, let me know if you were able to get the results you want.

Kindly,

Julie

Ah. Excellent. Thanks. Should have been looking at the docs to be honest!

No problem! We are here to help…

Have a great day!

Julie

Privacy | Site terms | Cookie preferences