Download: latest (1.8.0)

pymagery — python imagery


1.6.0 documentation / rgb_merge plugin

RGB merging is the opposite of the RGB split process. This plugin takes three separate images (one image per color channel) and merges them into a single RGB image.

The plugin prototype is:

def rgb_merge(r, g, b)

The plugin requires that all three input images be RGB images themselves. When merging, the red channel from r, the green channel from g, and the blue channel from b are copied as the red, green, and blue channels, respectively, of the image whose rgb_merge method was invoked. (Future plans include accepting a grayscale image as any channel thus negating the need for each input image containing its respective color channel.)

The following example splits an RGB image back into a duplicate image:

import pymagery i = pymagery.image('foo.ppm') r,g,b = i.rgb_split() j = pymagery.image().RGB_MERGE(r,g,b)

Note that the uppercase RGB_MERGE is used so that the image object can be returned without having to split the operation up into multiple lines.

Change Log