Reduce image size without distortation

Discussion in 'Programming' started by Silver89, Dec 12, 2008.

  1. #1
    I'm trying to make some thumbnails smaller but ig I just use css height:

    Then the image distorts, is this avoidable?

    Thanks
     
    Silver89, Dec 12, 2008 IP
  2. dfourss

    dfourss Well-Known Member

    Messages:
    1,271
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    128
    #2
    I'm not sure I thoroughly understand your question....I use blogger and after uploading a photo, I'll calculate the height/width ratio and then change the sizes, of both, appropriately
     
    dfourss, Dec 12, 2008 IP
  3. johnwill

    johnwill Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you have to make the image smaller then upload the smaller image to your server, use photoshop or something to resize it to the size you need, then upload it and change the size in css
     
    johnwill, Dec 13, 2008 IP
  4. electricshoe

    electricshoe Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is true, you can get by resizing them in 25% increments, like 50% or 75% smaller will usually look okay, but this doesn't work if your images are different sizes! It's usually best for you and the user to only load thumbnails anyways, that way you're not loading every single full image everytime the page is loaded.
     
    electricshoe, Dec 13, 2008 IP
  5. pitagora

    pitagora Peon

    Messages:
    247
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you can't with CSS alone. Browsers are very bad at resizeing images. This is something you should not let their algorithms do. You need to truly resize it with anything that knows how to resample it with either bicubic or at least a bilinear algorithm. IE and Firefox use nearest neighbor, which tend to give hard edges and sometimes ruins the image.
     
    pitagora, Dec 13, 2008 IP