当前位置: 首页>>代码示例>>Python>>正文


Python Image.background_color方法代码示例

本文整理汇总了Python中wand.image.Image.background_color方法的典型用法代码示例。如果您正苦于以下问题:Python Image.background_color方法的具体用法?Python Image.background_color怎么用?Python Image.background_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wand.image.Image的用法示例。


在下文中一共展示了Image.background_color方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _pdf_thumbnail

# 需要导入模块: from wand.image import Image [as 别名]
# 或者: from wand.image.Image import background_color [as 别名]
def _pdf_thumbnail(filename):
    img = WandImage(filename=filename + '[0]')
    img.background_color = Color('white')
    tw, th = get_thumbnail_size(img.height, img.width, 50, 50)
    img.resize(tw, th)
    rawData = img.make_blob('jpeg')
    return base64.b64encode(rawData)
开发者ID:CaliopeProject,项目名称:CaliopeServer,代码行数:9,代码来源:thumbnails.py

示例2: pdf2image

# 需要导入模块: from wand.image import Image [as 别名]
# 或者: from wand.image.Image import background_color [as 别名]
 def pdf2image(self,dest_width, dest_height):
     RESOLUTION    = 300
     #blob = self.datas.decode('base64')
     #raise Warning(self.base64_decode(self.datas))
     #str = self.datas + '=' *(-len(self.datas)%4)
     #img = Image(blob=self[0].datas.decode('base64'))
     #img.resize(dest_width,dest_height)
     #~ self[0].image = img.make_blob(format='jpg').encode('base64')
     img = Image(blob=self[0].datas.decode('base64'),resolution=(RESOLUTION,RESOLUTION))
     img.background_color = Color('white')
     self[0].image = img.make_blob(format='jpg').encode('base64')
开发者ID:vertelab,项目名称:odoo-account-extra,代码行数:13,代码来源:project_issue.py

示例3: Image

# 需要导入模块: from wand.image import Image [as 别名]
# 或者: from wand.image.Image import background_color [as 别名]
        pages = 1
        
        image = Image(
            width = imageFromPdf.width,
            height = imageFromPdf.height*pages          
           
        )
        
        for i in range(pages):
            image.composite(
                imageFromPdf.sequence[i],
                top = imageFromPdf.height * i,
                left = 0
            )
            
        image.resize(250,250)
        image.alpha_channel = False
        image.format = 'png'
        print(image.size)
        image.background_color = Color('pink')
        
        image.type = 'grayscale'
        image.caption = file.split('.')[0]
        image.save(filename = fileDirectory+file.split('.')[0]+".png")

        image.clear()
        image.close()

        #display(image)
开发者ID:alamsal,项目名称:thumbnailsFromPdf,代码行数:31,代码来源:extract_images.py


注:本文中的wand.image.Image.background_color方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。