Maintain Aspect Ratio

Share

What is "Maintain Aspect Ratio" in a Program?

Maintain aspect ratio means that if you change the width of an image or other object in a program, the height will be changed proportionally, or vice-versa, such that the aspect ratio of the object is maintained.

For example, if the size of an object is 100x200px, and you make its width 300 pixels, the height will become 600 pixels. If you made the height 50px, the width would become 25px, because the aspect ratio of this object is 1:2 (or 0.5).

Maintain aspect ratio is a feature found mainly in applications for editing images or video. Particularly when you try to change the resolution of an image, resize the canvas, or scale parts of images using a transform tool. It's generally a toggleable option, and it tends to be shown as a chain link or padlock icon between width and height that "binds" or "locks" the two dimensions together.

The location of the maintain aspect ratio button in MS Paint (red circle).
The location of the maintain aspect ratio button in MS Paint (red circle).

How Maintain Aspect Ratio Works?

It's basic rule of three math. We can calculate the new width and height using the following simple math formulas:

new width  = new height × old width  ÷ old height
new height = new width  × old height ÷ old width

Observe that old width ÷ old height is the aspect ratio itself.

For example, if the original size is 1600x900, that's a 1600:900 aspect ratio, which we can simplify to 16:9. When we calculate 1600 divided by 900 (or 16 divided by 9), we get the value 1.77777777777~.

The part old height ÷ old width is the same thing as the aspect ratio, except reversed. We can actually calculate this by doing:

height by width = 1 ÷ width by height

In this case, since our aspect ratio of width by height is 1.77~, we would do 1 ÷ 1.77~, which is 0.5625.

If we were to calculate using the ratio values, we would use the formulas:

new width  = new height × old width by height
new height = new width  × old height by width

For example, if we changed 1600x900 to 1280x720, we would have:

1280 =  720 × 1600 ÷ 900
1280 =  720 × 1.7777777777
720  = 1280 × 900 ÷ 1600
720  = 1280 × 0.5625

Other Names

In some applications, maintain aspect ratio has other names. For reference, some examples:

  • "Scale uniformly" - Inkscape, shown in the statusbar when the mouse cursor is over the transform handles of an object.
  • "Lock ratio" - Inkscape, shown in statusbar upon dragging a handle.
  • "Constrain proportions" - Krita, shown in Resize Canvas and Scale To New Size dialog boxes.
  • "Constrain aspect ratio" - tooltip of the above.
  • "Fixed aspect ratio" - GIMP, crop tool.
  • "Lock aspect ratio" - same as above.

Comments

Leave a Reply

Leave your thoughts! Required fields are marked *