'**SUMMARY**
Split the channels of an image into RGB (not the default BGR)
single parameter is whether to return the channels as grey images (default)
or to return them as tinted color image
**PARAMETERS**
* *grayscale* - If this is true we return three grayscale images, one per channel.
if it is False return tinted images.
**RETURNS**
A tuple of of 3 image objects.
**EXAMPLE**
>>> img = Image("lenna")
>>> data = img.splitChannels()
>>> for d in data:
>>>    d.show()
>>>    time.sleep(1)
**SEE ALSO**
:py:meth:`mergeChannels`'

def splitChannels(self, grayscale=True):

    r = self.getEmpty(1)
    g = self.getEmpty(1)
    b = self.getEmpty(1)
    cv.Split(self.getBitmap(), b, g, r, None)
    red = self.getEmpty()
    green = self.getEmpty()
    blue = self.getEmpty()
    if grayscale:
        cv.Merge(r, r, r, None, red)
        cv.Merge(g, g, g, None, green)
        cv.Merge(b, b, b, None, blue)
    else:
        cv.Merge(None, None, r, None, red)
        cv.Merge(None, g, None, None, green)
        cv.Merge(b, None, None, None, blue)
    return (Image(red), Image(green), Image(blue))
