Image alignment is something that always has to be done in
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.
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.
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
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.
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.
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.