【发布时间】:2021-07-29 19:10:34
【问题描述】:
在 Photoshop 中,我需要以 100% 和 10% 的格式导出文件。有没有一种简单的方法可以一次完成,而不必这样做两次?谢谢
【问题讨论】:
-
这是一个编码问题吗?如果没有,您可能应该在 Graphic Design stack exchange 上询问
-
10% 什么?您是在谈论图像大小还是 jpeg 质量?
在 Photoshop 中,我需要以 100% 和 10% 的格式导出文件。有没有一种简单的方法可以一次完成,而不必这样做两次?谢谢
【问题讨论】:
假设您在谈论 jpeg 质量。
稍微挖掘一下,您可以找到function to save as an image as jpg。
// Path to the two images, named appropriately
// NOTE change to suit your needs
var myFileA = "C:\\myfolder\\myjpeg_high_quality.jpg";
var myFileB = "C:\\myfolder\\myjpeg_low_quality.jpg";
// Jpeg quality used to be from 1-10 in the old days.
// Now it's from 1-12, Let's save out the best and the worst.
jpeg_it(myFileA, 12);
jpeg_it(myFileB, 1);
// function JPEG IT (file path + file name, quality)
// ----------------------------------------------------------------
function jpeg_it(filePath, jpgQuality)
{
if(! jpgQuality) jpgQuality = 12;
// jpg file options
var jpgFile = new File(filePath);
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpgQuality;
activeDocument.saveAs(jpgFile, jpgSaveOptions, true, Extension.LOWERCASE);
}
【讨论】: