Work
The scale factor (Product Images)
Both dimensions have to be multiplied by one number, so the box can only be met on one axis. Fitting inside chooses the smaller ratio and leaves a gap on the other axis, filling chooses the larger and crops the overflow.
Last updated
The Formula
fitting inside: s = min(W / w, H / h); filling and cropping: s = max(W / w, H / h)
Both dimensions have to be multiplied by one number, so the box can only be met on one axis. Fitting inside chooses the smaller ratio and leaves a gap on the other axis, filling chooses the larger and crops the overflow.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| w | Source width | pixels | Pixels across the original image. |
| h | Source height | pixels | Pixels down the original image. |
| W | Box width | pixels | Pixels across the target the platform asks for. |
| H | Box height | pixels | Pixels down the target the platform asks for. |
| s | Scale factor | ratio | The single number both dimensions are multiplied by. |
What Each Symbol Means
wpixels
Source width
Pixels across the original image.
hpixels
Source height
Pixels down the original image.
Wpixels
Box width
Pixels across the target the platform asks for.
Hpixels
Box height
Pixels down the target the platform asks for.
sratio
Scale factor
The single number both dimensions are multiplied by.
See It Worked With Real Numbers
A formula on its own does not tell you which number goes where. The how to resize product images page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.
Where This Formula Appears
This equation is the working core of How To Resize Product Images, filed under Everyday Life. Every number the guide produces comes from substituting into this one line.
Common Questions
What is the formula for The scale factor (Product Images)?
The formula for The scale factor (Product Images) is fitting inside: s = min(W / w, H / h); filling and cropping: s = max(W / w, H / h). Both dimensions have to be multiplied by one number, so the box can only be met on one axis. Fitting inside chooses the smaller ratio and leaves a gap on the other axis, filling chooses the larger and crops the overflow.
What does each symbol in The scale factor (Product Images) stand for?
w is source width; h is source height; W is box width; H is box height; s is scale factor.
What units should I use with The scale factor (Product Images)?
Substitute w in pixels, h in pixels, W in pixels, H in pixels, s in ratio. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.
What is a common mistake when using The scale factor (Product Images)?
Upscaling to reach a target. Scaling a 500-pixel image up to 2000 pixels produces a 2000-pixel file of a 500-pixel picture. The upload requirement is met and the listing looks worse, because the buyer's zoom reveals the blur within a second of opening it.