本文整理汇总了Python中pgmagick.Image.matte方法的典型用法代码示例。如果您正苦于以下问题:Python Image.matte方法的具体用法?Python Image.matte怎么用?Python Image.matte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pgmagick.Image
的用法示例。
在下文中一共展示了Image.matte方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: bobross
# 需要导入模块: from pgmagick import Image [as 别名]
# 或者: from pgmagick.Image import matte [as 别名]
def bobross(self,imgStr):
print "bobross()"
bob=Image('bob-transparent-canvas.png')
bob.matte(True)
#print "1"
img=Image(imgStr)
#print "2"
newsize=Geometry(200,343)
newsize.aspect(True)
img.scale(newsize)
#print "3"
img=self.watercolor(img)
#print "4"
result=Image(bob.size(),'white')
result.composite(img,392,22,CompositeOperator.OverCompositeOp)
result.composite(bob,0,0,CompositeOperator.OverCompositeOp)
return result
示例2: watercolor
# 需要导入模块: from pgmagick import Image [as 别名]
# 或者: from pgmagick.Image import matte [as 别名]
def watercolor(self,imgStr):
img=Image(imgStr)
img.blur(2,2)
img.oilPaint(5)
img.enhance()
img.sharpen()
pink=Color(250,218,221,75)
toplayer=Image(img.size(),pink)
toplayer.matte(True)
img.matte(True)
img.composite(toplayer,0,0,CompositeOperator.CopyOpacityCompositeOp)
img.blur(2,2)
#img.write('watercolor-output.png')
return img
示例3: watercolor
# 需要导入模块: from pgmagick import Image [as 别名]
# 或者: from pgmagick.Image import matte [as 别名]
def watercolor(self,imgObj):
print "watercolor()"
img=imgObj
#img.blur(2,2)
img.oilPaint(1)
img.enhance()
img.sharpen()
pink=Color(250,218,221,75)
toplayer=Image(img.size(),pink)
toplayer.matte(True)
img.matte(True)
img.composite(toplayer,0,0,CompositeOperator.CopyOpacityCompositeOp)
img.blur(0,1)
img.write('output.png')
return img
示例4: bobross
# 需要导入模块: from pgmagick import Image [as 别名]
# 或者: from pgmagick.Image import matte [as 别名]
def bobross(self,imgStr):
bob=Image('bob-transparent-canvas.png')
bob.matte(True)
img=self.watercolor(imgStr)
#img.matte(True)
newsize=Geometry(210,380)
newsize.aspect(True)
img.scale(newsize)
#img.oilPaint(3)
#img.enhance()
#img.sharpen()
#img.blur(2,2)
#img.shear(-25,-15)
result=Image(bob.size(),'white')
result.composite(img,390,20,CompositeOperator.OverCompositeOp)
result.composite(bob,0,0,CompositeOperator.OverCompositeOp)
#img.debug(True)
#bob.composite(img,390,20,CompositeOperator.OverCompositeOp)
return result