Answer the question
In order to leave comments, you need to log in
How to solve the problem with actions?
Guys, such a problem: how to record a frame so that it is not attached to the edited photo and simply cuts the area you need, like 16:9, etc. ?
Why doesn't photoshop apply cropping to all images. Because all the pictures are of different sizes and resolutions, and it is impossible to apply cropping in the operation, because it does not record it as a 16:9 crop, but takes information from the edited photo, and saves this step, for example, with the parameters: indent from the bottom so many pixels , indent from above and so on, to other photos. Actually, this format is not used, because everyone turns out different.
Answer the question
In order to leave comments, you need to log in
In actions you won't do this because you won't be able to calculate the available aspect ratio of the image. But in the script you can.
The simplest example:
// resize image to ratio 16:9
// ----------------------------
// This script resize image for aspect ratio 16:9
// ----------------------------
// create global variables
var doc = app.activeDocument;
var currentLayer = doc.activeLayer;
// get layer size
var layer = activeDocument.activeLayer;
var layerWidth = layer.bounds[2]-layer.bounds[0];
var layerHeight = layer.bounds[3]-layer.bounds[1];
// get layer ratio
var layerRatio = layerWidth / layerHeight;
// calculate new dimensions for canvas with aspect ratio 16:9
var newHeight = layerHeight * 9 / 16 * layerRatio;
//resize canvas
doc.resizeCanvas(layerWidth,newHeight);
magick *.jpg -gravity center -extent 16:9 -set filename:f %t result/%[filename:f].jpg
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question