调整在PhotoShop一批图像 [英] Resize batch images in PhotoShop

查看:246
本文介绍了调整在PhotoShop一批图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常美元,调整图像大小(很多人)为方形,然后用Photoshop保存它们的任务psented p $。例如,如果图像是400x200那么我需要调整画布是400×400。同样地,如果一个图像是321x850然后画布将被调整到850x850如果,并且如果所述图像是521x250然后画布将被调整到521x521

I am frequently presented with the task of resizing images (lots of them) to a square and then saving them with PhotoShop. For example, if an image is 400x200 then I would need to resize the canvas to be 400x400. Likewise, if an image is 321x850 then the canvas would be resized to 850x850 if, and if the image is 521x250 then the canvas would be resized to 521x521.

有没有在Photoshop的方式来自动完成这个繁琐的任务?我知道PhotoShop的自动化操作,能记录你的动作,但是这不是我想要的。我没有问题,编程解决方案,如果你能在正确的方向指向我。这可能吗?

Is there a way in PhotoShop to automate this tedious task? I know about PhotoShop automate, which records your actions, but that's not what I want. I have no problem programming the solution if you could point me in the right direction. Is this possible?

感谢您提前。这可能会救我的繁琐重复的工作几个小时。

Thank you in advance. This could save me hours and hours of tedious repetitive work.

推荐答案

使用Javascript:你可以使用这个答案以挑通过他们所选择的文件夹,然后循环中的所有文件。在循环中你要打开每个文件,像这样:

Using javascript: You can use this answer to pick all the files in a chosen folder and loop through them. Within the loop you'll want to open each file like so:

var doc = open(fileList[i]);

然后执行长VS宽度的检查:

then do a check of the length vs width:

if (doc.width !== doc.height) {             // if document is not already square...
    if (doc.width > doc.height) {               // if width is greater...
        doc.resizeCanvas(doc.width, doc.width)   // use this value for both sides...
    } else {                                      // else use height for both sides...
        doc.resizeCanvas(doc.height, doc.height)      // so you always get a square.
    }
}

保存并关闭:

doc.save();
doc.close();

根据您正在寻找有什么 doc.resizeImage()以及

的Adobe脚本指南

这篇关于调整在PhotoShop一批图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆