def RGBtoYCoCg(R, G, B):
    """ convert RGB to YCoCg color
    The YCoCg color model was developed to increase the effectiveness of the image compression.
    This color model comprises the luminance (Y) and two color difference components
    (Co - offset orange, Cg - offset green).
    :param R: red value (0;255)
    :param G: green value (0;255)
    :param B: blue value (0;255)
    :return: YCoCg tuple (0;255) """
    Y = (R / 4.0) + (G / 2.0) + (B / 4.0)
    Co = (R / 2.0) - (B / 2.0)
    Cg = (G / 2.0) - (R / 4.0) - (B / 4.0)

    return tuple(int(i) for i in (Y, Co, Cg))