You could convert the image into a numpy array using numpy.array(image) and then use numpy.delete() to remove a row before converting it back into an image with PIL.Image.fromarray().
例如,这将从图像中删除第7行。
a = numpy.array(im)
a = numpy.delete(a, 6, 0)
im = Image.fromarray(a)
This question is very similar to this one that has been answered already. Maybe that helps?
You could convert the image into a numpy array using
numpy.array(image)
and then usenumpy.delete()
to remove a row before converting it back into an image withPIL.Image.fromarray()
.例如,这将从图像中删除第7行。