Download: latest (1.8.0)

pymagery — python imagery


1.0.0 documentation / rgb_merge plugin

RGB splitting is the opposite of the RGB merge process. This plugin takes a single RGB image and splits each color channel into a separate image.

The plugin prototype is:

r,g,b = def rgb_split()

This plugin returns three RGB images with red channel in r as the red channel, green channel in g as the green channel, and blue channel in b as the blue channel. In effect, this duplicates the image thrice and zeros-out two color channels in each image.

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.