# A quick math question.

Discussion in 'BlackHat Lounge' started by jdog37, Sep 11, 2011.

1. ### jdog37Power Member

Joined:
Apr 3, 2009
Messages:
510
569
Occupation:
unemployed electrician
Location:
virginia
Its probably a simple equation but I have not been in school since 1988.

Suppose I have an image that is 750x450 and I want to increase or decrease the size.

Example: I have a 750x450 image and want to increase the width from 450 to 600. What type of equation could I use to determine what the 750 height would be changed to in relation to the 600 width?

Would appreciate the help.

Joined:
May 25, 2011
Messages:
783
1,419
(w2/w1)=x
x*h1=h2

(600/450)=1.33
1.33*750=1000

new dimensions 1000x600

w1 = old width
w2 = new width
h1 = old height
h2 = new height
x= the amount your multiplying size by
If you want to change the height of a 750x450 pic to 1200 then you would do

(h2/h1)=x
x*w1=w2

(1200/750)=1.6
1.6*450=720

• Thanks x 3
Last edited: Sep 11, 2011
3. ### SyZygySenior Member

Joined:
Dec 29, 2009
Messages:
864
1,083
Location:
Europe
lol, dude, you are sick haha

4. ### SophieElite Member

Joined:
Mar 5, 2009
Messages:
2,249
3,963
Gender:
Female
Occupation:
девушка
Never mind, probably be wrong. LOL!
Hey, I've not done math for years too. High 5, pal.

Last edited: Sep 11, 2011
5. ### BwahtRegular Member

Joined:
Jan 27, 2009
Messages:
292
244
An easier way is to just set up a proportion.

750/450 = x/600

Cross multiply to get 450x = 45,000.

x = 1,000

There you go. That should be right, just came in after a night of drinking irate:irate:

• Thanks x 2
6. ### blackmaPower Member

Joined:
Jul 9, 2009
Messages:
795
860
Occupation:
Blackhat Marketer (Full Time)
Location:
yendyS
Divide 450 by 600 = 0.75

Then divide 750 by 0.75
750/0.75 = 1000

• Thanks x 1
7. ### JeevsSupreme Member

Joined:
Dec 14, 2010
Messages:
1,374
1,642
In maths I'm like...2+2=4 but I'm not sure!

• Thanks x 3
8. ### jdog37Power Member

Joined:
Apr 3, 2009
Messages:
510
569
Occupation:
unemployed electrician
Location:
virginia
+rep... You are so awesome for typing out this post in such detail and in a way that even I can understand.

9. ### XoRaKRegular Member

Joined:
Oct 28, 2009
Messages:
319
253
Occupation:
social worker
Location:
Belgium

2+2=4 haha idiot, the right answer is 3!

10. ### JeevsSupreme Member

Joined:
Dec 14, 2010
Messages:
1,374
1,642
OMG! Genius! Must have used a calculator....

11. ### tony-raymondoJunior Member

Joined:
Jun 19, 2009
Messages:
181
459
just go to pixlr and make a white square

then let pixlr resize it to whatever you want

12. ### skyfallsdownRegular Member

Joined:
Oct 31, 2010
Messages:
380
170
It's something like this

750h.............450w
xh................600w

x=(750*600)/450=1000w

That's the width you need

13. ### OldFatGuyRegular Member

Joined:
Jun 4, 2009
Messages:
253
149
Not to be a dick, but when specifying dimensions like 750x450, it's WxH.. So I'd assume you're talking about going from 450 to 600 height and want to know the new width. As others have posted, you use the ratio calc which ends up with the new width being 1000.

14. ### ijof9Power Member

Joined:
Mar 27, 2010
Messages:
536
597
Occupation:
CTO
Location:
Western Europe
If you haven't learned this in school, you definitely won't manage to learn it down. You'll probably forget it but it's called the Rule of Three in math.
http://en.wikipedia.org/wiki/Rule_of_three_(mathematics)#Rule_of_Three

15. ### jdog37Power Member

Joined:
Apr 3, 2009
Messages:
510
569
Occupation:
unemployed electrician
Location:
virginia
Sure, I could do that... or I can use my photo editing software to do it. But with the right math equation that I ask for and received, I can use HTML in the image code and re-size it to my requirements with very little fuss.

16. ### skyfallsdownRegular Member

Joined:
Oct 31, 2010
Messages:
380
170
well it has nothing to do with The rule of three in our country ,it has no special name lol,just trying to be helpful

17. ### ijof9Power Member

Joined:
Mar 27, 2010
Messages:
536
597
Occupation:
CTO
Location:
Western Europe
Oh sorry mate, not you, that was for OP.

18. ### howard_hughesElite Member

Joined:
Jul 23, 2009
Messages:
5,057
3,698
Occupation:
Just Another Digital Marketer!
Location:
"Insta Rank"
You Don't Need An Eqation Mate..

Just Fire PhotoShop, Open That Image, Go To Image Size, when you enter the widht, The new height will show automatically

• Thanks x 1
19. ### GreyWolfExecutive VIP

Joined:
Aug 17, 2009
Messages:
1,935
5,644
Gender:
Male
Occupation:
Artist / Craftsman
Location:
sitting at my PC
Roparadise is right on and gave you a great simple equation to use.
Basically to enlarge or reduce an image you just have to multiply or divide both the height and the width by the same factor. To double a 10x10 image for example you would multiply width and height by 2 and get 20x20. If you don't know the factor but only know the new dimension you want then the equation Roparadise gave will figure that for you.

Like howard_hughes says though most photo editing software will do it for you. Just leave 'constrain proportions' checked and change one size and the software will change the other appropriately.

For html you can resize by just defining one of the dimensions the browser will resize the other appropriately (it's poor coding, but I do it all the time. lol).
Of course that's also wasting bandwidth because the full file image will be loaded and then the browser resizes it for display. It's usually better to actually resize the image file yourself when you can. That's why websites always have thumbnail files instead of just using height and width codes to make a thumbnail.

Last edited: Sep 11, 2011

Joined:
Nov 14, 2008
Messages:
286