Menu Close

Image Alignment: margins and proportions

Image alignment is something that always has to be done in product image retouching one way or another, and if you do it in a wrong way, you might waste a lot of time, and for a process that can be fully automatic in most cases. Let’s first discuss what this alignment is all about, and then talk about how it can be done in a nick of time without much effort from the retoucher.

Any online store, any marketplace, any website where product images are published, all of them have some specific demands for the images. You can’t just post whatever images you want, they have to be the same in terms of format, image size, resolution, background color, margins, proportions.

What we want is a working mechanism that will let us align all kinds of objects in the images automatically. It shouldn't matter if they are isolated or not. They can be isolated on white without a shadow, with a shadow, not isolated. They can be square or rectangular, they can be centered or they can stick to the top or to the bottom of the image. Models or objects, flat lays, mannequins – it doesn't matter. Wide or high, sticking to the side margins or to the top and bottom margins, whatever. What we want is to press a single button and align all sorts of images with just that.

Some contents or functionalities here are not available due to your cookie preferences!

This happens because the functionality/content marked as “Vimeo framework” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

But it's a long way to go. I guess I won't make much sense now if start explaining complicated things about edge detection, trimming, alpha-channels, selections handling, conditionals and so on. Let's start with something as simple as aligning an object isolated on white without shadows – this is probably the easiest thing we could do in catalogue retouching.

You'll have to position objects somehow. It's not about the size and the margins, it's about how to align images quickly.

When you work for an online store, you normally don't align images approximately by cropping them with the Crop Tool unless you're dealing with models. Yeah, models can be aligned just like that, but that's cropping, it has nothing to do with alignment. In most cases, you'll have some technical requirements, some guidelines for all kinds of images the online-store produces. For example, you might receive something like this: “Jpeg format, 800 pixels width, 1200 pixels height, 72 dpi, margins: 50 pixels left & right, 100 pixels top & bottom, object orientation – lower margin, mannequin orientation – upper margin. Isolation on white with no shadow”. What does that mean? You have to make sure that the resulting images are up to these standards, otherwise, you won’t get paid. They have to be the same size and resolution, and they have to have margins, and the objects have to stick to these margins. The objects have to be isolated on white, too, and there should not be any shadows left.

Now imagine yourself retouching while keeping these demands in mind. You have to isolate the images, then retouch them to look decent, remove all the defects and props etc, and then you have to resize and align them all to fit the specified margins. But how? Watch this video tutorial, just keep in mind that it's not the best way to align images, it's just a visual demonstration of the idea.

Some contents or functionalities here are not available due to your cookie preferences!

This happens because the functionality/content marked as “Vimeo framework” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

Let’s visualize the result. Let’s make a template of the correct size with the right margins. To do it, I’ll first create a new document of the specified size. It’s 800 pixels wide and 1200 pixels high. The background is white. Now for the margins. To see them without actually drawing anything on the image I’ll use guides. There’s a New Guide command in the View menu. Another way of adding guides to an image is this: when you have the rulers showing, which you can enable by pressing Ctrl-R, point your mouse somewhere at the ruler, click, hold, and drag. By pressing and holding Alt you can change the guide orientation from vertical to horizontal and vice versa. But in our case, it’s not reasonable to draw them like that, because it’s hard to hit a specific pixel value, and we must be very specific. So I’ll use the New Guide command instead. And I’ll also record an action because I might need these guides again.

I’ll make two vertical guides: one at the position of 50 pixels, which will be our left margin, and the other one at 750 pixels, which will be our right margin. Remember, that our image is 800 pixels wide, so when we subtract 50 pixels from that value we get 750. Now for the top and the bottom margins. Note that they are wider than the left and right ones. I’ll make two horizontal guides, one at 100 pixels and the other one at 1100. So, that’s it. Now let’s see how we can make an image fit these margins. Let’s do it manually just to see how much time it takes and how inaccurate the result is. I want to warn you that this is NOT a good way to align images for the catalogues. I'm only showing you how to do it because this is what comes as something natural to many retouchers.

I’ll take this mannequin from another image, copy it and paste into our template image. Then I’ll transform it in such a way so it doesn’t stick out of the margins. After that, I’ll apply the changes and this is it. But there are two problems: first of all, the process is too long. And then there’s a naming problem: the image with the margins is Untitled, while the image with the mannequin has an item name, and when you work with the images as a catalogue retoucher, most of the time you’ll be working with the named images, and these names are important and have to be preserved.

That was probably not the best idea how to align an image. But we learned one thing: to preserve names, we have to work with the original images, so let’s see how we can do that. I’ll switch to the mannequin image. But there are no margins here, how can I know what to do? Oh, but I’ve recorded an action which I can use. Let’s run it. Now the problem is that the image is actually much bigger than the resulting image, and our margins are somewhere in the corner. If I try to transform the mannequin to fit these margins, which can be done with some effort, I still have to resize the image. Well, not to resize actually, but to cut the excess canvas that we have here. I’ll access the Canvas Size command by pressing Ctrl-Alt-C and cut the image so it’s only 800 pixels wide and 1200 high, and then I click on this arrow in the upper left corner to tell the algorithm to cut it from the opposite side, that is not to cut our mannequin. Alright, now we have the right image size, the right margins, and the correct image name.

Open

But there’s still one problem that bothers me: the process is still too long and it’s still manual and not very accurate. Let’s see what else can be done to avoid any manual transformation of the image. It might not seem like a big deal, but trust me, if you're dealing with hundreds of images every day, you don't want to stretch them manually. Not ever.

Now it's a good time for the explanation of the most common image alignment methods. There are actually just three – trimming, manual selection, and edge detection. Let's start with the easiest one.

Aligning images via Trim

Top

On this website, we use first or third-party tools that store small files (cookies) on your device. Cookies are normally used to allow the site to run properly (technical cookies), to generate navigation usage reports (statistics cookies) and to suitable advertise our services/products (profiling cookies). We can directly use technical cookies, but you have the right to choose whether or not to enable statistical and profiling cookies. Enabling these cookies, you help us to offer you a better experience. If you choose to disable cookies, you won’t be able to watch the embedded videos. Cookie policy