/static/light_hatched_style/png_over_color.py
Python | 17 lines | 9 code | 6 blank | 2 comment | 0 complexity | f430193e161696fe77e6c3bcbdad71c8 MD5 | raw file
- #!/usr/bin/env python
- import sys
- import Image
- import ImageColor
- assert sys.version_info[:2] >= ( 2, 4 )
- over = Image.open( sys.argv[1] )
- color = ImageColor.getrgb( sys.argv[2] )
- new = Image.new( 'RGBA', over.size, color )
- # 'Over' is passed twice since it has an alpha channel -- it is it's own mask
- new.paste( over, over )
- new.save( sys.argv[3] )