在Python中从图像中删除颜色

时间:2019-11-13 00:26:29

标签: python colors

此代码删除了红色,但我无法删除其他颜色。

def removeRed(inLines, outfile):
    for i in range(3, len(lines)):
        line = lines[i]
        nums = line.split()
        outLine = ''
        for j in range(len(nums)):
            if j % 3 == 0:
                outLine = outLine + '0 '
            else:
                outLine = outLine + nums[j] + ' '
        outfile.write(outLine + '\n')

0 个答案:

没有答案