title: When opening image with PILLOW the image is modified
body: <p>When opening the postscript image with online tools all the pixels align correctly but when using pillow, the pixels are in different sizes.</p>
  <p>[Image of the problem]<br />
  <img src="https://i.stack.imgur.com/UJujN.png" alt="1" /></p>
  <p>[Image of the desired result]<br />
  <img src="https://i.stack.imgur.com/h7MOO.png" alt="2" /></p>
  <pre><code>def saveFile(canvas:tk.Canvas):
  
      EpsImagePlugin.gs_windows_binary = r'C:\Program Files\gs\gs9.56.1\bin\gswin64c'
  
      file_name = &quot;img&quot;
  
      canvas.postscript(file=f&quot;images\ps\{file_name}.ps&quot;, colormode='color')
  
      psimage=Image.open(f'images\ps\{file_name}.ps')
      psimage.save(f'images\png\{file_name}.png', &quot;png&quot;)
      psimage.close()
  </code></pre>
  <p>Keep in mind the pixels are not the size of a 'real' pixel, they are much bigger and changing the format to 'png' or 'jpg' didn't solve the problem.</p>
  <p>If someone knows the solution to this problem, I will greatly appreciate it.</p>
  <p>Sorry for the missing information, hopefully this is enough.</p>
  <p><a href="https://drive.google.com/drive/u/0/folders/1j1j74pec8MSZKRu16e2hrARRen4cpDDW" rel="nofollow noreferrer">Img.ps file as text</a></p>
  <p>And this is how the code generates the .ps file</p>
  <pre><code>import tkinter as tk 
  import random
  from save import saveFile
  
  
  pixels = []
  
  FIELD_SIZE = (1280, 720)
  PIXEL_SIZE = 10
  
  class random_pixels():
  
      def draw_full_screen(canvas):
          height = round(FIELD_SIZE[1] / PIXEL_SIZE)
          width = round(FIELD_SIZE[0] / PIXEL_SIZE)
          for y in range(height):
              for x in range(width):
                  color = [&quot;#&quot;+''.join([random.choice('ABCDEF0123456789') for i in range(6)])]
                  # color = &quot;#444&quot;
  
                  x_top_left = x * PIXEL_SIZE + 1
                  y_top_left = y * PIXEL_SIZE + 1
                  x_bottom_right = x_top_left + PIXEL_SIZE - 1
                  y_bottom_right = y_top_left + PIXEL_SIZE - 1 
                  resolution = width * height
  
                  util.draw_pixel(canvas, color, x_top_left, x_bottom_right, y_top_left, y_bottom_right, resolution)
  
                  canvas.update()
          canvas.update()
  
          print(&quot;\nPixels drawn!&quot;)
          print(&quot;\nSaving image...&quot;)
  
          saveFile(canvas) 
  
          canvas.focus_set()
  
          print('\nImage saved!')
  
  class util:
      def draw_pixel(canvas:tk.Canvas, color, x0, x, y0, y, pixels_to_draw=1):
  
              pixel = canvas.create_rectangle(x0, y0, x, y, fill=color, outline=color)
  
              pixels.append(pixel)
  
              print(f&quot;{len(pixels)}/{pixels_to_draw} | { round(len(pixels) / pixels_to_draw * 100, 2)}%&quot;)
  
              return None
  
      def get_theme(e, canvas, root):
  
          if len(pixels) != 0:
              canvas.delete('all')
              pixels.clear()
  
          root.focus_set()
  
          if e.char == &quot;g&quot;:
              random_pixels.draw_full_screen(canvas)
          canvas.focus_set()
  </code></pre>