title: Trying to paste images into a grid using PIL - Python
body: <p>I'm fairly new to Python, so apologies in advance for any stupidity. My objective is to take a set of square images and want to plot these into a n x n grid with no spacing in-between. I've some what been able to achieve this but I feel there is a much more efficient way, which handles multiple scenarios and dimensions. It may be that there are other modules are more suited, however at the moment I know of Pillow so attempting to use this.</p>
  <p>Current approach with a 2100 x 2100 image where sample_list is a list of 700 x 700 images:</p>
  <pre><code>
  positions = [(0,0),
              (0,700),
              (0,1400),
              (700,0),
              (700,700),
              (700,1400),
              (1400,0),
              (1400,700),
              (1400,1400)]
  
  a = Image.new('LA', (2100,2100))
  counter = 0
  
  for i in sample_list:
      a.paste(i, positions[counter])
      counter += 1
  
  </code></pre>
  <p>Any help would be massive appreciated</p>