def bytes_per_pixel(pixel_type):
    """
    Return the number of bytes per pixel for the given pixel type

    @param pixel_type:  The OMERO pixel type
    @type pixel_type:   String
    """
    if (pixel_type == "int8" or pixel_type == "uint8"):
        return 1
    elif (pixel_type == "int16" or pixel_type == "uint16"):
        return 2
    elif (pixel_type == "int32" or
          pixel_type == "uint32" or
          pixel_type == "float"):
        return 4
    elif pixel_type == "double":
        return 8
    else:
        raise Exception("Unknown pixel type: %s" % (pixel_type))