title: How to increase the resolution of an image in python- a possible solution?
body: <p>I had an interesting idea to increase the resolution of an image by copying every individual pixel 9 times in a grid. So, I went ahead and implemented it in python using the Pillow library.</p>
  
  <p>The issue here is that the image is not sharper or of high resolution than the earlier one. It still looks like the zoomed-in version of the previous image. Please take a gander for yourself.</p>
  
  <p><strong><em>1. The new image, generated by the program:-</em></strong> 
  <a href="https://i.stack.imgur.com/jvlzO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jvlzO.jpg" alt="enter image description here"></a></p>
  
  <p><strong><em>2. The older image, zoomed-in appropriately to match the size of the previous image:-</em></strong><a href="https://i.stack.imgur.com/hW2M8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hW2M8.png" alt="enter image description here"></a></p>
  
  <p>I want to know why does it not work as intended? why the image is not sharper? For what it's worth, I have tried to zoom out the new image to the size of the original image, but it's not sharper at all. It looks the same. </p>
  
  <p>My program works as intended but I am still reproducing it here for the sake of completeness. It makes the new image 9 times in size and 3 times wider and 3 times the original height.</p>
  
  <pre><code>import os
  from PIL import Image
  
  factor = 3
  
  che = Image.open('../dog.jpg')
  che.show()
  px = che.load()
  width, height = che.size
  
  
  img = Image.new('RGB', (width*factor, height*factor), 'Black')
  # img.show()
  pixels = img.load()
  for i in range(width):
      for j in range(height):
          pixels[factor*i, factor*j] = px[i, j]
          pixels[factor*i+1, factor*j] = px[i, j]
          pixels[factor*i+2, factor*j] = px[i, j]
  
          pixels[factor*i, factor*j+1] = px[i, j]
          pixels[factor*i+1, factor*j+1] = px[i, j]
          pixels[factor*i+2, factor*j+1] = px[i, j]
  
          pixels[factor*i, factor*j+2] = px[i, j]
          pixels[factor*i+1, factor*j+2] = px[i, j]
          pixels[factor*i+2, factor*j+2] = px[i, j]
  
  # img.show()
  img.save('../dog2.jpg')
  </code></pre>