Create pixmap of page.
    
    Args:
        matrix: Matrix for transformation (default: Identity).
        colorspace: (str/Colorspace) rgb, rgb, gray - case ignored, default csRGB.
        clip: (irect-like) restrict rendering to this area.
        alpha: (bool) include alpha channel

def getPixmap(page, matrix = None, colorspace = csRGB, clip = None,
              alpha = True):
    """Create pixmap of page.
    
    Args:
        matrix: Matrix for transformation (default: Identity).
        colorspace: (str/Colorspace) rgb, rgb, gray - case ignored, default csRGB.
        clip: (irect-like) restrict rendering to this area.
        alpha: (bool) include alpha channel
    """
    CheckParent(page)

    # determine required colorspace
    cs = colorspace
    if type(colorspace) is str:
        if colorspace.upper() == "GRAY":
            cs = csGRAY
        elif colorspace.upper() == "CMYK":
            cs = csCMYK
        else:
            cs = csRGB
    if cs.n not in (1,3,4):
        raise ValueError("unsupported colorspace")

    dl = page.getDisplayList()               # create DisplayList
    if clip:
        scissor = Rect(clip)
    else:
        scissor = None
    pix = dl.getPixmap(matrix = matrix,
                       colorspace = cs,
                       alpha = alpha,
                       clip = scissor)
    del dl
    return pix