已測試Mac系統(tǒng)下可行
前言
我們把PSD另存為PNG/JPG文件的時候,一般來說,文件會小很多。
然而有的時候網(wǎng)絡(luò)上的一些PSD素材導(dǎo)出PNG/JPG時,竟然有好幾十mb。
這可能就需要我們清除PSD的元數(shù)據(jù),給PSD瘦瘦身,這樣另存為的時候,才不會有異常大的PNG/JPG出現(xiàn)。
那么如何清除PSD元數(shù)據(jù)呢?
方法1:使用JSX腳本。
- 將以下代碼復(fù)制并保存為.JSX文件(參考來源Adobe論壇)
function deleteDocumentAncestorsMetadata() {
whatApp = String(app.name);//String version of the app name
if(whatApp.search("Photoshop") > 0) { //Check for photoshop specifically, or this will cause errors
//Function Scrubs Document Ancestors from Files
if(!documents.length) {
alert("There are no open documents. Please open a file to run this script.")
return;
}
if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");
var xmp = new XMPMeta( activeDocument.xmpMetadata.rawData);
// Begone foul Document Ancestors!
xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "DocumentAncestors");
app.activeDocument.xmpMetadata.rawData = xmp.serialize();
}
}
//Now run the function to remove the document ancestors
deleteDocumentAncestorsMetadata();
- 用Photoshop打開需要清除元數(shù)據(jù)的PSD
- Photoshop菜單里面選擇,文件-腳本-瀏覽,選中JSX文件,按確定。
- 保存PSD
方法2:使用Exiftool
Mac版示例
- 下載最新版文件并安裝 https://exiftool.org/
- Mac OS里面,打開Terminal, 輸入以下命令行:
exiftool -r -overwrite_original -XMP-photoshop:DocumentAncestors= ‘需要清理的文件路徑’
希望這篇文章對你有幫助。