PageRenderTime 23ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/static/june_2007_style/png_over_color.py

https://bitbucket.org/cistrome/cistrome-harvard/
Python | 17 lines | 9 code | 6 blank | 2 comment | 0 complexity | f430193e161696fe77e6c3bcbdad71c8 MD5 | raw file
 1#!/usr/bin/env python
 2
 3import sys
 4import Image
 5import ImageColor
 6
 7assert sys.version_info[:2] >= ( 2, 4 )
 8
 9over = Image.open( sys.argv[1] )
10color = ImageColor.getrgb( sys.argv[2] )
11
12new = Image.new( 'RGBA', over.size, color )
13
14# 'Over' is passed twice since it has an alpha channel -- it is it's own mask
15new.paste( over, over )
16
17new.save( sys.argv[3] )