Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我写了这段代码来清除图片中的蓝色:
def clearBlue(picture): for p in getPixels(picture): setBlue(p,0)
现在我需要最大化图像中的蓝色(255),如何用这段代码做到这一点?
您的函数称为 clearBlue 暗示您不想要蓝色元素,但您要求最大化 Blue 组件,这令人困惑。
您走在正确的轨道上,但是要将蓝色最大化到最大可能值(24 位颜色)是:
def clearBlue(picture): for p in getPixels(picture): setBlue(p, 255)