0

I need to take this image and rotate it 90d and print it in black and white colors. I need to do it with matplotlib or scipy.

import scipy.misc
import matplotlib.pyplot as plt
from scipy import ndimage

face = scipy.misc.face()
rotate = ndimage.rotate(face,90)
gray = rotate
plt.imshow(gray, cmap=plt.get_cmap('gray'), vmin=0, vmax=1)
plt.show()

I saw this code in few websites but the image it only rotated.

Fusu
  • 17
  • 4

1 Answers1

0

you could try:

from PIL import Image, ImageDraw
image = Image.open("convert.png")
image = image_file.convert('1')
image = image.rotate(90)
image.save('result.png')
Bando
  • 1,223
  • 1
  • 12
  • 31
  • I saw this solution but my teacher asked me to do it with scipy or matplotlib – Fusu Jun 18 '19 at 11:02
  • 1
    @importanceofbeingernest closed your question and has attached the answer of your question in another topic, good luck! – Bando Jun 18 '19 at 11:57