【发布时间】:2013-03-07 19:16:21
【问题描述】:
如何获得当前文档的位深度 (8/16/32)? 我正在使用 JavaScript。我查看了参考手册,但找不到任何属性或功能。
【问题讨论】:
标签: photoshop
如何获得当前文档的位深度 (8/16/32)? 我正在使用 JavaScript。我查看了参考手册,但找不到任何属性或功能。
【问题讨论】:
标签: photoshop
尝试使用 bitsPerChannel
alert(activeDocument.bitsPerChannel)
returns "BitsPerChannelType.EIGHT"
你可能想使用这个函数来改变位深度
convertBitDepth(8)
function convertBitDepth(bitdepth)
{
var id1 = charIDToTypeID( "CnvM" );
var desc1 = new ActionDescriptor();
var id2 = charIDToTypeID( "Dpth" );
desc1.putInteger( id2, bitdepth );
executeAction( id1, desc1, DialogModes.NO );
}
【讨论】: