Skip to content

Instantly share code, notes, and snippets.

@viktorbezdek
Last active October 30, 2023 14:45
Show Gist options
  • Save viktorbezdek/a44cdd4bf27735673bfe8d224a4280ee to your computer and use it in GitHub Desktop.
Save viktorbezdek/a44cdd4bf27735673bfe8d224a4280ee to your computer and use it in GitHub Desktop.

This formula ensures that each logo will occupy the same area, making them appear visually identical in size.

$$[ \text{New Height} = \left( \frac{\text{Target Area}}{\text{Original Width}} \right)^{0.5} ]$$

$$[ \text{New Width} = \text{Original Width} \times \left( \frac{\text{New Height}}{\text{Original Height}} \right) ]$$

Here:

  • Target Area: The area you want each logo to occupy (e.g., 10000 square pixels)
  • Original Width: The original width of the logo
  • Original Height: The original height of the logo
  • New Height: The new height of the logo after scaling
  • New Width: The new width of the logo after scaling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment