Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Formula for Crop Percentage to remove black borders on images

Formula for Crop Percentage to remove black borders on images 11 months, 3 weeks ago #160023

  • veganoption
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
  • 11 months, 3 weeks ago
I've been doing 3D effects on important transparent PNG images, and couldn't see a setting to stop Lightworks putting a black border around the image to pad it to the dimensions of the frame.

I worked out the formula, and figured it might be useful to someone else. Of course, you might have a vastly simpler solution.

So for an image where "w" is the width relative to the height, and the frame ratio is 16:9, the crop you need is:

0.5 - 9w/32

Generalised for ratio r (where 16:9 = 16/9), the formula is:

0.5 - w/2r = (1-w/r)/2

Is this a "well, duh?", or was it 15 minutes well spent?

Re: Formula for Crop Percentage to remove black borders on images 11 months, 3 weeks ago #160039

  • jwrl
  • Moderator
    Pro User
  • OFFLINE
  • Moderator
  • Posts: 9573
  • 11 months, 3 weeks ago
Personally, I think that it's fifteen minutes well spent. I use a slightly different approach that relies on magic numbers 1, .5625 and .5, but yours is more generalised. Welcome to the forums, and thank you for adding to the knowledge level.

Perhaps it could restated as (1 - R/r)/2, where R is the source video ratio and r the destination? As an example, converting 4:3 to 16:9 would then simplify to (1 - 3/4)/2, or (4 - 3)/(4 * 2). When we ultimately solve that we would get 0.125.

When did this turn into Mathematics 101?

PS: If you "wasted" fifteen minutes I just wasted another ten! Personally, I prefer well spent.
Last Edit: 11 months, 3 weeks ago by jwrl.
  • Page:
  • 1
Time to create page: 0.43 seconds
Scroll To Top