您的位置 首页 > 数码极客

ps如何删除通道

PS是一款栅格图像编辑软件,具有许多强大的功能,本文演示如何通过脚本实现删除亮度通道蒙板相关功能,展示从互联网收集而来的一个小插件,供大家学习交流,请勿用于商业用途。

1.插件界面

本文界面是一系列功能的一部分,将逐步展示,但是功能界面是共同的,如下图所示:


2.关键代码-删除亮度通道蒙板

大家可通过源代码阅读,来掌握相关技巧,源代码如下:

// jamEngine.jsxinc v4.4 (minified) if (typeof jamEngine !== 'object') { var jamEngine = {}; (function () { var that; jamEngine.meaningfulIds = false; jamEngine.parseFriendly = false; var conflictingStringIdStrs = { "'Algn'": ["align", "alignment"], "'AntA'": ["antiAlias", "antiAliasedPICTAcquire"], "'BckL'": ["backgroundLayer", "backgroundLevel"], "'BlcG'": ["blackGenerationType", "blackGenerationCurve"], "'BlcL'": ["blackLevel", "blackLimit"], "'Blks'": ["blacks", "blocks"], "'BlrM'": ["blurMethod", "blurMore"], "'BrgC'": ["brightnessEvent", "brightnessContrast"], "'BrsD'": ["brushDetail", "brushesDefine"], "'Brsh'": ["brush", "brushes"], "'Clcl'": ["calculation", "calculations"], "'ClrP'": ["colorPalette", "coloredPencil"], "'Cnst'": ["constant", "constrain"], "'CntC'": ["centerCropMarks", "conteCrayon"], "'Cntr'": ["center", "contrast"], "'CrtD'": ["createDroplet", "createDuplicate"], "'CstP'": ["customPalette", "customPhosphors"], "'Cstm'": ["custom", "customPattern"], "'Drkn'": ["darken", "darkness"], "'Dstr'": ["distort", "distortion", "distribute", "distribution"], "'Dstt'": ["desaturate", "destWhiteMax"], "'FlIn'": ["fileInfo", "fillInverse"], "'Gd '": ["good", "guide"], "'GnrP'": ["generalPreferences", "generalPrefs", "preferencesClass"], "'GrSt'": ["grainStippled", "graySetup"], "'Grdn'": ["gradientClassEvent", "gridMinor"], "'Grn '": ["grain", "green"], "'Grns'": ["graininess", "greens"], "'HstP'": ["historyPreferences", "historyPrefs"], "'HstS'": ["historyState", "historyStateSourceType"], "'ImgP'": ["imageCachePreferences", "imagePoint"], "'In '": ["in", "stampIn"], "'IntW'": ["interfaceWhite", "intersectWith"], "'Intr'": ["interfaceIconFrameDimmed", "interlace", "interpolation", "intersect"], "'JPEG'": ["JPEG", "JPEGFormat"], "'LghD'": ["lightDirection", "lightDirectional"], "'LghO'": ["lightOmni", "lightenOnly"], "'LghS'": ["lightSource", "lightSpot"], "'Lns '": ["lens", "lines"], "'Mgnt'": ["magenta", "magentas"], "'MrgL'": ["mergeLayers", "mergedLayers"], "'Mxm '": ["maximum", "maximumQuality"], "'NTSC'": ["NTSC", "NTSCColors"], "'NmbL'": ["numberOfLayers", "numberOfLevels"], "'PlgP'": ["pluginPicker", "pluginPrefs"], "'Pncl'": ["pencilEraser", "pencilWidth"], "'Pnt '": ["paint", "point"], "'Prsp'": ["perspective", "perspectiveIndex"], "'PrvM'": ["previewMacThumbnail", "previewMagenta"], "'Pstr'": ["posterization", "posterize"], "'RGBS'": ["RGBSetup", "RGBSetupSource"], "'Rds '": ["radius", "reds"], "'ScrD'": ["scratchDisks", "screenDot"], "'ShdI'": ["shadingIntensity", "shadowIntensity"], "'ShpC'": ["shapeCurveType", "shapingCurve"], "'ShrE'": ["sharpenEdges", "shearEd"], "'Shrp'": ["sharpen", "sharpness"], "'SplC'": ["splitChannels", "supplementalCategories"], "'Spot'": ["spot", "spotColor"], "'SprS'": ["separationSetup", "sprayedStrokes"], "'StrL'": ["strokeLength", "strokeLocation"], "'Strt'": ["saturation", "start"], "'TEXT'": ["char", "textType"], "'TIFF'": ["TIFF", "TIFFFormat"], "'TglO'": ["toggleOptionsPalette", "toggleOthers"], "'TrnG'": ["transparencyGamutPreferences", "transparencyGrid", "transparencyGridSize"], "'TrnS'": ["transferSpec", "transparencyShape", "transparencyStop"], "'Trns'": ["transparency", "transparent"], "'TxtC'": ["textClickPoint", "textureCoverage"], "'TxtF'": ["textureFile", "textureFill"], "'UsrM'": ["userMaskEnabled", "userMaskOptions"], "'c@#^'": ["inherits", "pInherits"], "'comp'": ["comp", "sInt64"], "'doub'": ["floatType", "IEEE64BitFloatingPoint", "longFloat"], "'long'": ["integer", "longInteger", "sInt32"], "'magn'": ["magnitude", "uInt32"], "'null'": ["null", "target"], "'shor'": ["sInt16", "sMInt", "shortInteger"], "'sing'": ["IEEE32BitFloatingPoint", "sMFloat", "shortFloat"] }; jamEngine.getConflictingStringIdStrs = function (charIdStr) { return conflictingStringIdStrs[charIdStr] || null; }; jamEngine.uniIdStrToId = function (uniIdStr) { var id = 0; if (typeof uniIdStr === 'string') { if === (1 + 4 + 1)) && (0) === "'") && (5) === "'")) { id = a(1, 5)); } else { id = a(uniIdStr); } } return id; }; var smallestHashValue = a(" "); jamEngine.idToUniIdStrs = function (id) { var charIdStr = ""; var stringIdStr = a(id); if (id >= smallestHashValue) { charIdStr = "'" + a(id) + "'"; if (stringIdStr !== "") { if (charIdStr in conflictingStringIdStrs) { stringIdStr = conflictingStringIdStrs[charIdStr]; } } } return [charIdStr, stringIdStr]; }; jamEngine.equivalentUniIdStrs = function (uniIdStr1, uniIdStr2) { return (uniIdStr1) === (uniIdStr2); }; function putInReference(ref, containers) { if === Array) { var count = con; for (var i = 0; i < count; i++) { var container = (containers[i]); var desiredClassId = (container[0]); var typedValue = (container[1]); var form = typedValue[0]; var value = typedValue[1]; switch (form) { case"<class>": ref.putClass(desiredClassId); break; case"<enumerated>": var enumerated = (value); ref.putEnumerated(desiredClassId, (enumerated[0]), (enumerated[1])); break; case"<identifier>": ref.putIdentifier(desiredClassId, value); break; case"<index>": ref.putIndex(desiredClassId, value); break; case"<name>": ref.putName(desiredClassId, value); break; case"<offset>": ref.putOffset(desiredClassId, value); break; case"<property>": ref.putProperty(desiredClassId, (value)); break; default: throw new Error("[jamEngine putInReference] Unknown reference form: " + form); break; } } } else { throw new Error("[jamEngine putInReference] JavaScript array expected"); } } function putInList(list, items) { if === Array) { var count = i; for (var i = 0; i < count; i++) { var item = (items[i]); var type = item[0]; var value = item[1]; switch (type) { case"<boolean>": li(value); break; case"<class>": li((value)); break; case"<data>": li(value); break; case"<double>": li(value); break; case"<enumerated>": var enumerated = (value); li((enumerated[0]), (enumerated[1])); break; case"<integer>": li(value); break; case"<largeInteger>": li(value); break; case"<list>": var actionList = new ActionList(); putInList(actionList, value); li(actionList); break; case"<object>": var object = (value); if (object[1]) { var actionDescriptor = new ActionDescriptor(); putInDescriptor(actionDescriptor, object[1]); li((object[0]), actionDescriptor); } else { li((object[0])); } break; case"<path>": var fileRef = new File(value); li(fileRef); break; case"<reference>": var actionReference = new ActionReference(); putInReference(actionReference, value); li(actionReference); break; case"<string>": li(value); break; case"<unitDouble>": var unitDouble = (value); li((unitDouble[0]), unitDouble[1]); break; default: throw new Error("[jamEngine putInList] Unknown list type: " + type); break; } } } else { throw new Error("[jamEngine putInList] JavaScript array expected"); } } function putInDescriptor(desc, members) { if === Object) { for (var key in members) { if (key)) { var keyID = (key); var member = (members[key]); var type = member[0]; var value = member[1]; switch (type) { case"<boolean>": de(keyID, value); break; case"<class>": de(keyID, (value)); break; case"<data>": de(keyID, value); break; case"<double>": de(keyID, value); break; case"<enumerated>": var enumerated = (value); de(keyID, (enumerated[0]), (enumerated[1])); break; case"<integer>": de(keyID, value); break; case"<largeInteger>": de(keyID, value); break; case"<list>": var actionList = new ActionList(); putInList(actionList, value); de(keyID, actionList); break; case"<object>": var object = (value); if (object[1]) { var actionDescriptor = new ActionDescriptor(); putInDescriptor(actionDescriptor, object[1]); de(keyID, (object[0]), actionDescriptor); } else { de(keyID, (object[0])); } break; case"<path>": var fileRef = new File(value); de(keyID, fileRef); break; case"<reference>": var actionReference = new ActionReference(); putInReference(actionReference, value); de(keyID, actionReference); break; case"<string>": de(keyID, value); break; case"<unitDouble>": var unitDouble = (value); de(keyID, (unitDouble[0]), unitDouble[1]); break; default: throw new Error("[jamEngine putInDescriptor] Unknown descriptor type: " + type); break; } } } } else { throw new Error("[jamEngine putInDescriptor] JavaScript object expected"); } }

3.作者答疑


代码长度过长,如需全部项目或有疑问,请留言。

提示: 作者联系方式
提示: 插件开发流程 - 知乎

责任编辑: 鲁达

1.内容基于多重复合算法人工智能语言模型创作,旨在以深度学习研究为目的传播信息知识,内容观点与本网站无关,反馈举报请
2.仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证;
3.本站属于非营利性站点无毒无广告,请读者放心使用!

“ps如何删除通道”边界阅读