def tga_pixel_bytes_size(parent=None, attr_index=None, new_value=None, **kwargs
    ):
    """Size getter for the byte size of tga pixel data"""
    if new_value is not None:
        return
    if parent is None:
        raise KeyError('Cannot calculate the size of tga ' +
            'pixels without without a supplied parent.')
    if attr_index is not None and hasattr(parent[attr_index], '__len__'):
        return len(parent[attr_index])
    header = parent.parent.header
    pixels = header.width * header.height
    image_type = header.image_type
    if image_type.format == 0:
        return pixels // 8
    elif header.bpp in (15, 16):
        return 2 * pixels
    return header.bpp * pixels // 8
