Download: latest (1.8.0)

pymagery — python imagery


1.7.0 documentation / bitplane_merge plugin

Bit plane merging is the opposite of the bitplane_split process. This plugin takes a set of monochrome imsges and merges them back into one grayscale image.

The plugin prototype is:

def bitplane_merge(p0,p1,p2,p3,p4,p5,p6,p7)

This plugin modifies the image it is called on and merges the bit planes into grayscale values.

The following example splits an image, saves each bit plane, then merges them back into a duplicate image:

import pymagery i = pymagery.image('foo.ppm') original = i.copy() planes = i.bitplane_split() [planes[k].save('foo-bitplane-%d.ppm' % k) for k in range(len(planes))] i.bitplane_merge(planes)

An example image is shown below:

Bit Plane Result Image
Merged
7
6
5
4
3
2
1
0

The most-significant bit planes contain the most structure of the image while the least-significant bit planes appear more as noise. This observation is the basis of steganography (imperceptible hiding of data in images).

Change Log