Skip to main content
Participant
July 5, 2017
Question

Crop to Widest Dimension of Selection

  • July 5, 2017
  • 4 replies
  • 883 views

Image > Crop will crop the image to a selection, but I need to crop to the selections widest dimension only, creating a square image. Anybody know of a way to accomplish this?

    This topic has been closed for replies.

    4 replies

    Norman Sanders
    Legend
    July 6, 2017

    Sometimes, despite the obvious efficiency of scripts and plug-ins, there is satisfaction of solving a problem using only Photoshop regular tools . Here is one such solution, doing the work on a duplicate of the original file.

    1. Cmd+J to place the selected element on a separate layer

    2. Choose both layers. Choose the Move tool. Options bar: Align vertical centers followed by Align horizontal centers. Un-choose both layers. Choose Layer 1 and dupe it. Turn off the Background layer.

    3. Choose Layer 1 Copy. Edit > Transform > Rotate 90 Degrees

    4. Choose Layer 1 and Layer 1 Copy. Image > Trim …Transparent pixels. Then un-choose the layers, choose Layer 1 Copy and drag it to the trash.

    JJMack
    Community Expert
    Community Expert
    July 5, 2017

    In my crafting action package I include a Plug-in script I wrote for making aspect Ratio selections or paths that are rectangular or oval.  The Plug-in records the Aspect Ratio you set in the action step dialog when you record the action step. No dialog is displayed when your action plays. Its like scripted  marguee and path tool. The selection is set respective to the Image orientation the selection will have the image's orientation or be square or round.  The Aspect Ratio is not a width height thing it is a ratio. the Script take into account the image orientation and set the best selection for the image.  For portraits do not crop well to a landscape orientation and landscaped do not crop to portrait orientation well too much content would be cropped off the resulting composition will not be acceptable in general.

    A two step action will do  or you can do the two steps in Photoshop UI.

    Automate Aspect Ratio Selection

    Image Crop

    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains

    Example
    Download

    JJMack
    Randy Hufford
    Community Expert
    Community Expert
    July 5, 2017

    Lightroom would probably be the easiest solution. From the develop module crop first image with a 1;1 ratio. Than select all images and sync cropping to all images. You can than go to each image and move the crop to best look. How to Crop and Resize Photos for Slideshow in Adobe Lightroom - YouTube

    JJMack
    Community Expert
    Community Expert
    July 5, 2017

    Something like that may work in a case when all images are the same size and orientation.  IMO most user have image the have various aspect ratios and have both Portraits and Landscape image and me even have stitched images.   I do not use Lightroom so I have not Idea what would be the best approach to use in Lightroom

    In Photoshop I create Slideshow for 10 different Display devices is a single run of the Image Processor Pro Pulg-in in conjunction with my plug-in. Why would one want a square sideshow?  You want them for the device that will be displaying them. No all 16:9 or 1080P etc. For example for my surface pro 3  will create image file with an ar of 3 ant 2. Portraits will have a width of 1440 and a height or 2160 where Landscapes will have a width of 2160 and a height of 1440,  You rotate the Surface pro 3 to the correct orientation for the image being displayed. Image for mt 4k display will have a 16 9 aspect ratio and landscape images will display  3840x2160px where the 2160x3840 portraits are fitted to the displays height of 2160

    JJMack
    c.pfaffenbichler
    Community Expert
    Community Expert
    July 5, 2017

    I would recommend a Scripting approach.

    Photoshop Scripting

    JJMack
    Community Expert
    Community Expert
    July 5, 2017

    An image have one width.  A square crop is a 1:1 aspect ratio selection. Portraits aspect ratio image can be crop square to its width dimension with a 1:1 aspect ratio selection.. Which crop would you want. Landscape Images  can not be cropped square to their width size.  A 1:1 Aspect selection the width of a Landscape image would exceed the image's canvas size.

    You can make a 1:1 aspect ratio selection in an image in either orientation.  The max size for a portrait would be a 1:1 selection the is the width of the image and the max size in a landscape would be the height of the landscape.  The selected area can me anywhere in the image canvas.

    JJMack
    Participant
    July 6, 2017

    The images contain paths, so they can be converted to selections and used to base the crop on. The images could be landscape or portrait though, and I need a 1:1 crop based on the widest dimension.

    c.pfaffenbichler
    Community Expert
    Community Expert
    July 6, 2017

    What if the square would exceed beyond the Canvas?