代码如下,中间那三行两层 for 循环迭代的代码,是否可以去掉 for 循环??感谢指点。。 def jpeg2png(path, name, mask=(255, 255, 255), limit=32): img = Image.open(path) arr = np.array(img.convert('RGBA')) for i in range(arr.shape[0]): for j in range(arr.shape[1]): arr[i,j,3] = 0x00 if np.all(np.abs(arr[i,j,:3] - mask) arr, for, mask, path