SHARE
TWEET

Untitled

a guest Jun 25th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diamond = np.array([[  0,   0,   0,   0, 255,   0,   0,   0,   0],
  2.        [  0,   0,   0, 255,   0, 255,   0,   0,   0],
  3.        [  0,   0, 255,   0,   0,   0, 255,   0,   0],
  4.        [  0, 255,   0,   0,   0,   0,   0, 255,   0],
  5.        [255,   0,   0,   0,   0,   0,   0,   0, 255],
  6.        [  0, 255,   0,   0,   0,   0,   0, 255,   0],
  7.        [  0,   0, 255,   0,   0,   0, 255,   0,   0],
  8.        [  0,   0,   0, 255,   0, 255,   0,   0,   0],
  9.        [  0,   0,   0,   0, 255,   0,   0,   0,   0]], dtype=uint8)
  10.  
  11. size = 36
  12. my_dpi = mpl.rcParams['figure.dpi']
  13. plt.subplots(figsize=(size/my_dpi, size/my_dpi))
  14. plt.axis('off')
  15. img = Image.fromarray(diamond, 'L')
  16. img.resize((size,size)).save('diamond.ppm')
  17. plt.imshow(img)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top