# Finding the percentage to scale in img [closed]

I am trying to scale one img based on its size on the screen to a size of max space on my paper. I want to get a percentage so that way I could just plug it into my calculator and easily convert each size of the elements of the img to the proportional size of the space provided. The space on the paper is not proportional to the size of the original img. So the draw img doesn't have to take up the whole space in the space on the paper. The space is just for reference of how much is available.

## closed as unclear what you're asking by Namaste, José Carlos Santos, Claude Leibovici, user91500, kingW3Sep 11 '17 at 17:31

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

## 1 Answer

I'm not sure exactly what you're looking for, but here's an example problem in this general domain. Suppose you have an original picture of dimensions $W \times H$, and you need it to fit into a space with dimensions $x \times y$.

Then compute $r_1 = x/W$ and $r_2 = y/H$, and find $r = \min\{r_1, r_2\}$. That is the scaling factor of the maximal copy of the original that will fit into the given space. The basic reasoning is that a scaling of $r_1$ will get the picture to fit just right horizontally, while a scaling of $r_2$ will get the picture to fit just right vertically. In order for it to fit in both directions, the picture must be scaled to the minimum of those two.

• What does "r" mean? Is it rectangle? – GBikeZ8 Sep 2 '17 at 23:49
• It doesn't really matter what it's called, but I intended it to represent "ratio". – Brian Tung Sep 2 '17 at 23:50
• Would finding the size of the space to draw in and multiplying it by 100 and deciding it by the original size get your the same answer? If so how would I go about converting the elements from the original to the new using the percentage gotten here? – GBikeZ8 Sep 3 '17 at 0:17
• What does minimum mean? – GBikeZ8 Sep 3 '17 at 5:53
• Also would the picture be proportional to the original even if the drawing space is smaller by x and larger by y. That doesn't seem to possible. – GBikeZ8 Sep 3 '17 at 6:33