title: Python 3.4: Where is the image library?
body: <p>I am trying to display images with only builtin functions, and there are plenty of Tkinter examples online. However, none of the libraries work:</p>
  
  <pre><code>import Image  # none of these exist.
  import tkinter.Image
  import _tkinter.Image
  etc
  </code></pre>
  
  <p>However, tkinter <em>does</em> exist, a hellow-world with buttons worked fine.</p>
  
  <p>I am on a MacBook pro 10.6.8 and using PyCharm. </p>
  
  <p><strong>Edit: The best way so far (a little slow but tolerable):</strong></p>
  
  <p>Get the pixel array as a 2D list (you can use a third-party .py to load your image).
  Now you make a data array from the pixels like this (this is the weirdest format I have seen, why not a simple 2D array?). This may be sideways, so you may get an error for non-square images. I will have to check. </p>
  
  <p>Imports:</p>
  
  <pre><code>from tkinter import *
  import tkinter
  
  data = list()  # the image is x pixels by y pixels.
  y = len(pixels)
  x = len(pixels[0])
  for i in range(y):
      col_str.append('{')
      for j in range(x):
          data.append(pixels[i][j]+" ")
      data.append("} ")
  data = "".join(data)
  </code></pre>
  
  <p>Now you can create an image and use put: </p>
  
  <pre><code># PhotoImage is builtin (tkinter). 
  # It does NOT need PIL, Pillow, or any other externals.
  im = PhotoImage(width=x, height=y)
  im.put(col_str)
  </code></pre>
  
  <p>Finally, attach it to the canvas:</p>
  
  <pre><code>canvas = tkinter.Canvas(width=x, height=y)
  canvas.create_image(x/2, y/2, image=GLOBAL_IMAGE)  # x/2 and y/2 are the center.
  
  tK.mainloop()  # enter the main loop and it will be drawn.
  </code></pre>
  
  <p><strong>Image must be global or else it may not show up</strong> because the garbage collector gets greedy.</p>