2012-07-18 103 views
3

我经常将调整大小的图像(大量)调整为正方形,然后使用PhotoShop保存它们。例如,如果图像是400x200,那么我需要将画布大小调整为400x400。同样,如果图像是321x850,那么画布将调整到850x850,如果图像是521x250,则画布将调整大小为521x521。在PhotoShop中调整批量图像的尺寸

PhotoShop有没有一种方法可以自动执行这个单调乏味的任务?我知道PhotoShop的自动化,它记录你的动作,但这不是我想要的。如果您能指出正确的方向,我对编程解决方案没有任何问题。这可能吗?

预先感谢您。这可以节省我几个小时冗长的重复性工作。

+0

我认为你应该使用VSO图像调整器,有时我必须做类似的事情,你必须设置模式为中心,这就是全部。 – Kamil 2012-07-20 12:29:45

+0

使用JS编写脚本应该对我很好,谢谢 – Xolani 2012-07-25 12:47:54

回答

7

使用javascript:您可以使用this answer选取所选文件夹中的所有文件并循环播放它们。在循环中,你会想打开每个文件,像这样:

var doc = open(fileList[i]); 

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

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 scripting guides

+0

谢谢我会试试这个解决方案 – Xolani 2012-07-23 09:40:59

4

批量调整图片在Mac OS X

您可以轻松地批量调整的Mac OS X内一组图像使用附带的预览应用程序,因此不需要任何额外下载或昂贵的照片编辑应用程序,只有预览,这是免费的与您的Mac!下面是如何做到这一点:

1. Select all the images you want resized and open them within Preview 
2. From Preview, select the images that you want to batch resize from the drawer (Command+A will select them all) 
3. Now, go to the menu labeled Tools, and then Adjust Size 
4. Enter a value for what you want the new width and height to be 
5. Next, navigate to the File menu and click Save All 
6. All the images you selected are now resized! 

这适用于Mac OS X几乎所有版本都包含的预览,批量调整大小!

0

使用此脚本它出错。

if (doc.width !== doc.height) {    // if document is notalready 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. 
    } } 

它说,在网上非法使用的其他4

+0

您错误地关闭了括号......在else语句之前,您应该有一个单独的括号。我会推你的最后一个下线,并保持你的缩进/嵌套 - 帮助你发现什么时候循环不正确 – 2013-11-22 13:41:31

0

错误发生,因为存在丢失的“}”在行结束3 的,如果长期有接近的东西之前期限被打开。

if (doc.width !== doc.height) {    // if document is notalready 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. 
}