Quantcast
Viewing all articles
Browse latest Browse all 22

Resizing with maintained aspect ratio applet

Maybe I'm just way too old school, but when dealing with resizing anything, I like to jot down a simple fractional equation. For example, if there's a video that's 530 x 298 pixels and you need to resize that to 505 pixels wide, and maintain the aspect ratio:

First, setup the simple equation like so:

Image may be NSFW.
Clik here to view.
\frac {530}{298}=\frac {505}{y}

Second, cross-multiply the fraction:

Image may be NSFW.
Clik here to view.
530*y = 505 * 298

Then solve for y, divide both sides by 530:

Image may be NSFW.
Clik here to view.
y = \frac{505 * 298}{530}

And you may want to round the answer:

Image may be NSFW.
Clik here to view.
y = 283.9433962264...

Image may be NSFW.
Clik here to view.
y \approx 284

Original Resized (Rounded)
Width:
Height:

 

In general terms, if you have:

Image may be NSFW.
Clik here to view.
\frac {a}{b}=\frac {c}{d}

Formulas for solving c and d are:

Image may be NSFW.
Clik here to view.
c = \frac{(a* d)}{b}\ ; d = \frac{(b* c)}{a}

The post Resizing with maintained aspect ratio applet appeared first on Dino's Anabasis.


Viewing all articles
Browse latest Browse all 22

Trending Articles