Cropping and Padding of Textures

We received this question over e-mail

Is it possible to crop the sides of a texture?

Thanks!
O

Hi,

Sure it is. You can use Texture crop node to do that. Please see below:

In step 1 I create a new FullHD texture.

In step 2, I add transparent padding to the left and right. Please note the top-left (TL) and bottom-right (BL) points are calculated based on percentage, so if you need a precise pixel value you need to calculate the percentage yourself.

In step 3, I crop the sides of the texture to get the original one.

I hope this helps!
Meetya

Hi, thanks for answering.

Is that possible to do it with Video file? My source is actually mp4 files. (lots of them)

I did reduce my canvas size to 1278x1080 px, however, my projector output is 1920*1080 px, my video now have been stretch back to its original size. So, is there a way to crop out the projector resolution to make it the final output size is 1278 x 1080 px?

Maybe I’m completely off, but have you tried adjusting the resolution of the canvas and the projector? You can do that by selecting them in the main window and adjusting the resolution in the properties on the right.

From the image you posted I can see that both still have 1080p resolution, that’s why I thought that this might help you.

Let me know how it goes

To add to my reply: I think the core of your problem is that the aspect ratio of 1920x1080 and 1278x1080 is not the same, so either you’ll have your content stretched or you’ll have some black padding.

Looking forward to hear how it goes,
Mitja

Hi, I did it already just change the projector resolution on the right with the video output resolution. Many thanks.

1 Like