Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Outline cropping 1:1

New Here ,
Aug 24, 2023 Aug 24, 2023

The task is to crop a lot of pictures into a square (1:1) format in Adobe Photoshop 2023 on Mac OS.
The original aspect ratio of the picture is 4:3 (horizontally). By default, the crop tool is inside the image and completely fills it vertically so that the left and right parts of the image are cut off. I need to create an automation that will crop images in such a way that the crop field is outside the image vertically and includes the entire original image, creating empty areas at the top and bottom. I can't figure out how to make such an action. Please help. I understand how to do it manually with a separate picture in a 1:1 ratio or with the same proportions. When creating an action with this cropping, each new picture is cropped differently. How can this be automated to make it work?
Please help! Thank you! 1.jpg

TOPICS
Actions and scripting , macOS
793
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Explorer , Aug 24, 2023 Aug 24, 2023

try this script

if (app && app.documents.length > 0) {
    var activeDocument = app.activeDocument;
   
    var originalWidth = activeDocument.width.value;
    var originalHeight = activeDocument.height.value;
 
    var squareSize = originalWidth;
 
    var heightDiff = originalHeight - squareSize;
 
    var x = 0;
    var y = heightDiff / 2;
   
    var cropRegion = [x, y, x + squareSize, y + squareSize];
   
    activeDocument.crop(cropRegion);
   
    app.refresh();
} else {
    alert("No Open files.");
}
Translate
People's Champ , Aug 24, 2023 Aug 24, 2023
Flatten the image. Duplicate the layer. Rotate it 90 degrees. Do Reveal All. Delete temporary layer.
 
Translate
Adobe
Community Expert ,
Aug 24, 2023 Aug 24, 2023

Using fit image and or canvas size is often the key. There are many topics on this, search the forum for keywords such as square or 1:1.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 24, 2023 Aug 24, 2023

try this script

if (app && app.documents.length > 0) {
    var activeDocument = app.activeDocument;
   
    var originalWidth = activeDocument.width.value;
    var originalHeight = activeDocument.height.value;
 
    var squareSize = originalWidth;
 
    var heightDiff = originalHeight - squareSize;
 
    var x = 0;
    var y = heightDiff / 2;
   
    var cropRegion = [x, y, x + squareSize, y + squareSize];
   
    activeDocument.crop(cropRegion);
   
    app.refresh();
} else {
    alert("No Open files.");
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Aug 24, 2023 Aug 24, 2023
Flatten the image. Duplicate the layer. Rotate it 90 degrees. Do Reveal All. Delete temporary layer.
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 27, 2023 Aug 27, 2023

@Matthias3186186838nz 

 

You have three replies, did any of them provide the "correct answer" for you? If so, please mark as correct. If not, please describe your issue.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2023 Sep 08, 2023
LATEST

As @Matthias3186186838nz appears to have gone AWOL, I have marked correct replies.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines