title: Canvas not getting captured while saving tkinter python
body: <p>[SOLVED]
  Please don't judge the code. I just need to fix one bug with capturing canvas into file.
  As you can see I've tried multiple solutions and still while saving file is all-white...</p>
  <p>Do you have any soulutions to that?</p>
  <p>This app is to generate randomly dots on canvas with option to save it.
  it works when number of dots is above 40000 and rectangle is black.
  But otherwise is white.</p>
  <p><img src="https://i.stack.imgur.com/RmDTP.jpg" alt="enter image description here" /></p>
  <pre><code>HEIGTH = 207
  WIDTH = 207
  
  
  
  
  def snapsaveCanvas():
      fname = filename.get()
      my_window.update_idletasks()
      my_window.update()
      canvas.update()
      canvas.update_idletasks()
      ps = canvas.postscript(colormode='color')
      img = Image.open(io.BytesIO(ps.encode('utf-8')))
      img.save(fname + &quot;.bmp&quot;, 'bmp')
      print(&quot;done&quot;)
  
  
  
  
  
  canvas = tk.Canvas(frame2, width=HEIGTH, height=WIDTH, background='white')
  canvas.grid(row=0, column=0)
  canvas.create_rectangle(4, 4, 206, 206)
  </code></pre>