minitutorials main logo the place to learn online

Sponsor This Site!
Sponsorship Details - miniTutorials is taking enquiries into various Sponsorship opportunities. Available NOW! Read More on our Sponsorship page.
This Page Sponsored by :
Proudly Sponsored by Your Company name here!
miniTutorials Sponsorship
Donate!
Consider donating to keep this site alive and up to date. Click on the Donate button to go straight to PayPal site and make a donation of an amount you choose.


More information on where the money goes on the Donations page.
Discussion Forums
visit the mini tutorial forums
For expert help and advice on any of our Tutorials or anything else .... visit the forums and ask away!!
Google Ads
My Profile

Details about the owner of this site can be found at :-

ohloh profile
View Gavin McDonald's profile on LinkedIn
Powered by a
UK2 Dedicated Server

Windows Specific

Resizing Images to same dimensions

Introduction

A rough guide to resizing Images to have the same dimensions without the loss of quality and without distortion.

There are occasions when you need to have a number of images at the exact same width and height in order for them to display correctly. The images may come from different sources and so unlike say a digital camera may well be quite varied in their height and width. One such occasion came up for me recently in that the Oscommerce Shopping Cart requires that all images be of a certain size - sure, you can specify what size in terms of width and height in pixels, but then this specification becomes a rule for all cart images. (There are 3 groups , but still, all images in each group have the same limitation).

So what to do about it ? Well, the trick is in the 'canvas' of the image, not the image itself. Below are the steps I took to make all my images the same size in width and height - I chose 150 x 150 - making the width and height the same makes for good thumbnail images also when resized by oscommerce and other programs for a thumbnail view. As you'll soon see, the dimensions you choose will depend heavily on the set of images you are working with.

This is a rough guide - I will return and clean it up later adding more comments then as neccessary.


Step One - Resize all images to same height.

For this tutorial I'll pretend to work with 5 images (I actually used this technique with over 100 recently!). Supposing the dimensions of the 5 images are :-

89x154, 173x190, 240x260, 240x360, 200x165

A bit of a mix there. Now we don't want to distort our images by enlarging the height of any of them, so we look at all the heights, find the smallest height and work to that. In this case the smallest height is 154 so if we make all the images 150 in height we are safe.

Working with multiple images can be time consuming, with maybe just these 5 you can do each one individually but it's nice to know there are programs out there that can resize multiple images at once. One such handy program - and free too! - is the aptly named mir.NET - 'mir' meaning Multiple Image Resizer - the .NET part means that it requires the .NET Framework to be installed on the computer - if not there is a complete with .NET version available.

This being a first draft rough guide I wont go into the how-tos of using mir.NET, it is very easy to use. I may do that later when I get more time. For now I'll assume that you have used it to now resize all images to be 150px in height.

Now, this means that all the widths have changed for our example 5 images to approximatly :-

87x150, 137x150, 139x150, 100x150, 182x150

Ok, we're getting there, we have all images at 150px in height, we now need to get all the widths the same.

Step 2 - Resize all images to the same width, without changing the height.

For the first 4 images in our example 5 images this is easy. Using another paint program - I used Paint Shop Pro 7 for this - we resize the 'Canvas' now to 150x150, if neccesary choosing options to keep the image centralized.

You may notice though that the last image, number 5 in our example set has a width that is still above our 150 maximum so we perform an extra action on this one, we resize the width to 150 using PSP 7 or mir.net again if you like - meaning that image number 5 will now become approx 150x124.

Now we can perform the 'Canvas resize' on this image like we did with the other 4, making the canvas 150x150 with centrlized image.

Summary

And there you have it, 5 images of varying widths and heights all now at 150x150 and no distortion of loss of quality. Programs like Oscommerce will now happily display these images at full size 150x150 and thumbnailed at 75x75 also without distortion.

This has been a rough guide miniTutorial brought to you by ipv6guru - who promises to extend it sometime soon and add example images along the way so you can see what has been explained here.

 

tutorial sponsors logo

About Us | Site Map | Privacy Policy | Contact Us | ©2002 - 2007 miniTutorials.com