我想裁剪图像使用qazxsw POI,qazxsw POI和POI qazxsw(裁剪背景了学校图片)。
我的想法是部分图像关到比我需要的,然后操纵Alpha通道,使这些区域透明,因此所有我留下了是我所需要的零件的零件其他广场。我有一个开端的代码,但就死在相同的错误消息。
我试图做出某种圈面膜的裁剪面了,但口罩的概念仍然是国外对我,所以我想这会更容易些。
matplotlib
os.path
你会发现,很多与PIL /枕头容易。与菲奥娜的这一形象开始...
numpy
fig, ax = plt.subplots(1, 1)
# Show the image data in a subplot
ax.imshow(img, interpolation='none')
# Show the figure on the screen
row = len(img)
column = len(img[0])
for row in range(0, 231) :
for column in range(0, 330) :
img[row][column] = [0, 0, 0, 0]
fig.show()
Results: 26 for row in range(0, 231) :
27 for column in range(0, 330) :
---> 28 img[row][column] = [0, 0, 0]
29
30
IndexError: index 288 is out of bounds for axis 0 with size 288
这是我们创造阿尔法遮掩: