title: Implementing a python code to a cython code
body: <p>I have tried to implement the following python script into cython to decrease the running time. I have very little experience with python and/or cython. I tried to use something like the following lines, but did not work. Is it any "easy" ways of running the python script in cython or must I change the entire script?</p>
  
  <pre><code># What I tried:
  import time
  import pyximport; pyximport.install()
  import kandetlykkes
  
  # The python codes:
  import timeit
  start = timeit.default_timer()
  from PIL import Image, ImageDraw # Importerer biblioteket
  
  # Load image:
  input_image = Image.open("beatles.jpg") # Loads an image from the hard drive
  input_pixels = input_image.load()
  
  # Box Blur kernel
  box_kernel = [[1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 / 9, 1 / 9], [1 / 9, 1 / 9, 1 / 9]]
  
  # Select kernel here:
  kernel = box_kernel
  
  # Middle of the kernel
  offset = len(kernel) // 2
  
  # Creating the output image
  output_image = Image.new("RGB", input_image.size)
  draw = ImageDraw.Draw(output_image)
  
  
  # Beregne konvolusjon mellom intensity (original bilde) og  kernel 
  for x in range(offset, input_image.width - offset):
      for y in range(offset, input_image.height - offset):
          acc = [0, 0, 0]
          for a in range(len(kernel)):
              for b in range(len(kernel)):
                  xn = x + a - offset
                  yn = y + b - offset
                  pixel = input_pixels[xn, yn]
                  acc[0] += pixel[0] * kernel[a][b]
                  acc[1] += pixel[1] * kernel[a][b]
                  acc[2] += pixel[2] * kernel[a][b]
  
  draw.point((x, y), (int(acc[0]), int(acc[1]), int(acc[2])))
  
  output_image.save("Beatles box blurr.png")
  
  stop = timeit.default_timer()
  
  print('Time: ', stop - start)  
  </code></pre>