Most recent edit on 2007-11-10 23:20:24 by GusMueller
Deletions:
vilicer
Edited on 2007-11-10 21:53:45 by ErrolCadom
Additions:
vilicer
Edited on 2007-11-10 18:15:16 by GusMueller
Deletions:
bocdarcotro
Edited on 2007-11-10 14:39:07 by AcvarBocac
Additions:
bocdarcotro
Oldest known version of this page was edited on 2007-09-11 18:34:41 by GusMueller []
Page view:
And here is an example which takes the current bitmap layer and converts it to grayscale using
CoreImage. It also setups a keyboard shortcut, using Control-Command-G:
import objc
ACScriptSuperMenuTitle = "Color"
ACScriptMenuTitle = "Make Grayscale (python)"
ACShortcutKey = 'g'
ACShortcutMask = "command control"
CIColor = objc.lookUpClass('CIColor')
CIFilter = objc.lookUpClass('CIFilter')
def main(image):
color = CIColor.colorWithRed_green_blue_(0.5, 0.5, 0.5)
filter = CIFilter.filterWithName_('CIColorMonochrome')
filter.setDefaults()
filter.setValue_forKey_(image, 'inputImage')
filter.setValue_forKey_(color, 'inputColor')
filter.setValue_forKey_(1, 'inputIntensity')
return filter.valueForKey_('outputImage')
Back to
AcornPlugins