{a pulle{a color}将一个新的像素映射成一个复杂的像素(让它把一个新的像素映射成一个新的像素,并把它作为一个新的颜色映射,使之与一个新的rgb值兼容):
import random
def rand_rgb(*_) -> tuple:
return random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)
我想做的是使用一些for(最好)高级并行性,比如multiprocessing
:
如果pixelaccess
是一个“普通”的Python矩阵,意味着一个列表列表,那么这种类型的东西就可以工作了,图像中的每一行像素都将被单独处理,但是这并不完全有效,因为据我所见,pixel access object
不是列表列表。在
我该如何进行并行化呢?在
您可以始终使用numpy:
这是我得到的1050x700输入图像:
相关问题 更多 >
编程相关推荐