We have various images with various aspect ratios and need to create uniform square icons. Forunately, all our images have the same background color (white) so that simplifies this job.

First, we go to Photoshop's History, Action tab and click on the folder icon to create a new set.

After clicking on the folder, Photoshop will ask you to name the set. This is where you may group various actions into a class or group.

Next, you may create a new action by clicking on the icon next to the folder or set icon.

Once you name the action, click on Record and you will begin recording all steps you take from here on. Be sure that you have already opened the file you want to use as your template process for this recorded action.

The red record icon indicates that the recording has begun.

In our case, we want to first resize based on the long side of each image so that when we create a static height and width for the square icons, they are uniformly set to expand the white space to fill the extra or blank portions of the image. Otherwise, larger images may be cropped and smaller images may look odd.

We set the long side, in this case the width, to a length that will work well with all of the images. Our goal is not yet to resize these to the eventual size, reserving a final resampling until later.

To create square images, we will now adjust the canvas. The image size is based on the original image. We preserved the aspect ratio of the original image (default) so we don't yet have a square image for those images that are rectangular.

When we set the short side length to match the long side, we are going to alter the aspect ratio of the image. What was once a rectangle will now become a square. The canvas extension color is white, to match our background.
It is important to note that if the space we want to fill is to the left, right, top or bottom of the image we need to choose the arrow we want to set as the base for the new image. In this example, we want our image centered. So, the center box is selected.

The end result should show you what you're looking for.

Now we save the image. Using the save as feature allows us to avoid overwriting the original.

Here we choose the file type.

Next, choose the quality if you are saving to a compressed format like JPG. Since we are placing this online, a JPG is the best format for this kind of image.

Our saving process has been recorded and that step is now part of this recorded behavior.

To start a batch, click on File, Automate, Batch.

Choose your Set and Action to run. To use the save features which create the JPG graphics we want, we override the "Save As" command.

Choose an output directory and then run the batch.
