Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 10 of 10
  1. #1
    Senior Member duck444's Avatar
    Join Date
    Feb 2003
    Location
    east coast
    Posts
    403
    Member #
    751
    Liked
    2 times



    I have a relatively square image that has to fit in in a box on a template with relatively rectangular parameters. But no matter how I try to resize the image, it looks squished and distorted. Even when I use or do not use "keep aspect ratio", it still gets stretched. I don't want to resize the box on the template because I would have to move too much around.

    How can I get the image to fit in the box and still not stretch or distort?

    Thanks.

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Show us a link to your site, or some page where we can see it.
    duck444 likes this.


  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    If your box and your image have different proportions (not sizes, proportions) they will not fit perfectly. If the picture is, for example, 3 inches by 3 inches, and the box is 6 by 6, it will fit. If the box is 6 by 4, it won't.

    There's a thing in Photoshop called Content Aware Scale, where you can sometimes fudge the image and stretch it or shrink it without too much distortion, but you have to do it in Photoshop, then save it and upload it.

    There's no way that I know of to make a square image fit a rectangular box without distortion, by code alone.
    duck444 likes this.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    I normally end up just cropping the image to the right proportions... Only way to keep from distorting the original image... But that won't always work... Since I mostly work with my own images... I can usually get away with it...

    When I stage a photo, I normally try to keep the subject at less than 30% of the frame... So I have room to manipulate and crop the image as needed, when needed.

  6. #5
    Member
    Join Date
    Dec 2012
    Location
    Maryland
    Posts
    49
    Member #
    34357
    Liked
    6 times
    Adobe Fireworks has a tool called 9 slice scaling that is aimed at this sort of scenario. Haven't played around with it much other than to know it exists and its general purpose
    duck444 likes this.

  7. #6
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    It may be that you're declaring height and width attributes in the <img> tag. This is especially true if you're using a CMS. I ran into the same issue with Wordpress. Those attributes will cause problems for image scaling.
    duck444 likes this.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  8. #7
    Senior Member duck444's Avatar
    Join Date
    Feb 2003
    Location
    east coast
    Posts
    403
    Member #
    751
    Liked
    2 times
    is there anyway to take a rectangular photo?

  9. #8
    Member paulo f's Avatar
    Join Date
    Jan 2013
    Location
    Im about here.
    Posts
    50
    Member #
    34366
    Hi,

    If you scale the image it wont be streched, problem is that you may be scaling to much for the current resolution of the image.
    If you give me the image and the size of the rectangular box ill gladly test it for you.

    As a rule of thumb, each time you double the image size you cut in half the image resolution.
    <Signature Here/>

  10. #9
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    Show us the image.
    Maybe with some photoshop techniques, the image could be altered by adding something on the sides.


  11. #10
    Senior Member duck444's Avatar
    Join Date
    Feb 2003
    Location
    east coast
    Posts
    403
    Member #
    751
    Liked
    2 times
    No need to share image now. I was able to figure it out thanks to Apple's iPhoto using its "custom constrain" feature as a guide. Whew. It basically allows me to highlight a white box of any size around a picture to give me an idea of what it will look like cropped at those dimensions instead of resized. The trick is to shrink the image a bit while retaining aspect ration, then use the "custom constrain" feature as a guide on where to crop it. Stretching is gone. just have to take the picture again from further away to get the whole person in the pic at a decent size.

    Apple iPhoto saves the day. Wasn't even the latest version, either. Really easy considering the three day ordeal I went through pulling out my hair and all.

    I have been coming here since 2006 with my problems and you guys are always there. Thanks.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:41 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com