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:

  1. first split image rgb channels.
  2. use point multiply channel factor (1.5 in example, on r channel).
  3. 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:

enter image description here

with red channel multiplied 1.5 (its bit redder..):

enter image description here


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -