python - Multiply each pixel in an image by a factor -
i have image created using bayer filter , colors off. need multiply rg , b of each pixel factor ( different factor r, g , b each) correct color. using python imaging library , of course writing in python. there way efficiently?
thanks!
here how it:
- first split image rgb channels.
- use
pointmultiply channel factor (1.5in example, on r channel). - merge channels back.
heres code:
import image im = image.open('1_tree.jpg') im = im.convert('rgb') r, g, b = im.split() r = r.point(lambda i: * 1.5) out = image.merge('rgb', (r, g, b)) out.show() original:
with red channel multiplied 1.5 (its bit redder..):

Comments
Post a Comment