1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

A quick math question.

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

  1. jdog37

    jdog37 Power Member

    Joined:
    Apr 3, 2009
    Messages:
    510
    Likes Received:
    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.
     
  2. Roparadise

    Roparadise BANNED BANNED

    Joined:
    May 25, 2011
    Messages:
    786
    Likes Received:
    1,417
    (w2/w1)=x
    x*h1=h2

    So for your example
    (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 Thanks x 3
    Last edited: Sep 11, 2011
  3. SyZygy

    SyZygy Senior Member

    Joined:
    Dec 29, 2009
    Messages:
    864
    Likes Received:
    1,080
    Location:
    Europe
    Home Page:
    lol, dude, you are sick haha
     
  4. BlackSeng

    BlackSeng Jr. VIP Jr. VIP

    Joined:
    Mar 5, 2009
    Messages:
    1,963
    Likes Received:
    3,519
    Occupation:
       
    Location:
    SG50
    Never mind, probably be wrong. LOL!
    Hey, I've not done math for years too. High 5, pal.
     
    Last edited: Sep 11, 2011
  5. Bwaht

    Bwaht Regular Member

    Joined:
    Jan 27, 2009
    Messages:
    292
    Likes Received:
    243
    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 :pirate::pirate:
     
    • Thanks Thanks x 2
  6. blackma

    blackma Power Member

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

    Then divide 750 by 0.75
    750/0.75 = 1000
     
    • Thanks Thanks x 1
  7. Jeevs

    Jeevs Supreme Member

    Joined:
    Dec 14, 2010
    Messages:
    1,359
    Likes Received:
    1,628
    In maths I'm like...2+2=4 but I'm not sure! :p
     
    • Thanks Thanks x 3
  8. jdog37

    jdog37 Power Member

    Joined:
    Apr 3, 2009
    Messages:
    510
    Likes Received:
    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. XoRaK

    XoRaK Regular Member

    Joined:
    Oct 28, 2009
    Messages:
    303
    Likes Received:
    250
    Occupation:
    social worker
    Location:
    Belgium

    2+2=4 haha idiot, the right answer is 3! ;)
     
  10. Jeevs

    Jeevs Supreme Member

    Joined:
    Dec 14, 2010
    Messages:
    1,359
    Likes Received:
    1,628
    OMG! Genius! Must have used a calculator....
     
  11. tony-raymondo

    tony-raymondo Junior Member

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

    then let pixlr resize it to whatever you want
     
  12. skyfallsdown

    skyfallsdown Regular Member

    Joined:
    Oct 31, 2010
    Messages:
    375
    Likes Received:
    165
    It's something like this

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

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

    That's the width you need
     
  13. OldFatGuy

    OldFatGuy Regular Member

    Joined:
    Jun 4, 2009
    Messages:
    253
    Likes Received:
    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. ijof9

    ijof9 Power Member

    Joined:
    Mar 27, 2010
    Messages:
    536
    Likes Received:
    594
    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. jdog37

    jdog37 Power Member

    Joined:
    Apr 3, 2009
    Messages:
    510
    Likes Received:
    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. skyfallsdown

    skyfallsdown Regular Member

    Joined:
    Oct 31, 2010
    Messages:
    375
    Likes Received:
    165
    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. ijof9

    ijof9 Power Member

    Joined:
    Mar 27, 2010
    Messages:
    536
    Likes Received:
    594
    Occupation:
    CTO
    Location:
    Western Europe
    Oh sorry mate, not you, that was for OP.
    You already seem to know about it, one way or another.
     
  18. howard_hughes

    howard_hughes Elite Member

    Joined:
    Jul 23, 2009
    Messages:
    5,048
    Likes Received:
    3,684
    Occupation:
    Just Another Digital Marketer!
    Location:
    "Insta Rank"
    Home Page:
    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 :D


    :p
     
    • Thanks Thanks x 1
  19. GreyWolf

    GreyWolf Executive VIP Jr. VIP

    Joined:
    Aug 17, 2009
    Messages:
    1,930
    Likes Received:
    5,389
    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
  20. yousefgreat

    yousefgreat Regular Member

    Joined:
    Nov 14, 2008
    Messages:
    282
    Likes Received:
    180
    (Width2/Width1)*Height1 = HEIGHT2
     
    • Thanks Thanks x 1