• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image Resize : Maintain Proportions But Fill Negative Space

[eluser]Jim Higgins[/eluser]
Is it possible with the Image Manipulation Class (or some other technique) to resize an image while maintaining the proportions, but to fill in the negative space with a solid color? ... not by wrapping the image in a div with a background color, but adding a fill to the actual image.

So, for example, if I have a set of thumbnail images which should be 100x75 and I have an image with a vertical orientation... so say it's 100x150... and I resize it to fit that 100x75 thumbnail space, but I maintain the proportions and it ends up as a 50x75 image. Can I fill in the 25 pixels to the left and right of the image with a solid color?

Check out the 11th example from the top on this page (100x150, keeping ratio, filling top and bottom)?

That's basically what I'm trying to do, except this example shows a horizontal image with the top and bottom filled in with a solid color.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.