title: Why does my image have a thick black line around?
body: <p>In Pygame, I have wrote a Minesweeper clone. However, when I blit the final image stating <strong>YOU LOSE</strong> or <strong>YOU WIN</strong>, I get this result:</p>
  
  <p><img src="https://snag.gy/LV0eY.jpg" alt="enter image description here"></p>
  
  <p>I'm sure you notice the thick black line surrounding the text. Here is the function in which the image is blitted onto the window:</p>
  
  <pre><code>def play():
      SIZE = (WIDTH, HEIGHT) = (16, 16)
      MINES = 40
      PIXELS_PER_CELL = 30
      pygame.init()
      screen = pygame.display.set_mode((WIDTH * PIXELS_PER_CELL,
                                        HEIGHT * PIXELS_PER_CELL))
      pygame.display.set_caption("PyMines")
      board = create_board(SIZE, MINES)
      board.draw(screen)
      while True:
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  pygame.quit()
                  sys.exit()
              elif (event.type == pygame.MOUSEBUTTONDOWN and board.is_playing and
                    not board.is_solved):
                  board.mouse_handler(event, screen)
  
          message = None
          if not board.is_playing:
              board.show_mines(screen)
              message = pygame.image.load("images/lose.png").convert_alpha()
          elif board.is_solved:
              message = pygame.image.load("images/win.png").convert_alpha()
  
          if message:
              message = pygame.transform.scale(message, (screen.get_width(),
                                                         screen.get_height() //
                                                         5))
              screen.blit(message, (0, 0))
          pygame.display.update()
  </code></pre>
  
  <p>As I am not sure which part of the code you should be looking at, <a href="http://pastebin.com/CcFHixnL" rel="nofollow noreferrer">here</a> is the full code.</p>
  
  <p>Another reason why I think this behaviour is so bizarre, is that when I first created PyMines, the image blitted perfectly like so (as you can see, there is a very slight shadow to the text):</p>
  
  <p><img src="https://i.stack.imgur.com/mvF8w.jpg" alt="enter image description here"></p>
  
  <p>This however, is not a optimized version, as after each cycle, the whole board is redrawn (so it takes a very long time on a 16x16 board as shown in the first image, so I used a 9x9 - but the results are the same). Here is the <code>play()</code> function of the original version:</p>
  
  <pre><code>def play():
      SIZE = (WIDTH, HEIGHT) = (9, 9)
      MINES = 10
      PIXELS_PER_CELL = 30
      pygame.init()
      screen = pygame.display.set_mode((WIDTH * PIXELS_PER_CELL,
                                        HEIGHT * PIXELS_PER_CELL))
      pygame.display.set_caption("PyMines")
      board = create_board(SIZE, MINES)
      while True:
          for event in pygame.event.get():
              if event.type == pygame.QUIT:
                  pygame.quit()
                  sys.exit()
              elif (event.type == pygame.MOUSEBUTTONDOWN and board.is_playing and
                    not board.is_solved):
                  board.mouse_handler(event, screen)
  
          message = None
          if not board.is_playing:
              board.show_mines()
              message = pygame.image.load("lose.png").convert_alpha()
          elif board.is_solved:
              message = pygame.image.load("win.png").convert_alpha()
  
          board.draw(screen)
          if message:
              message = pygame.transform.scale(message, (screen.get_width(),
                                                         screen.get_height() //
                                                         5))
              screen.blit(message, (0, 0))
          pygame.display.update()
  </code></pre>
  
  <p>I would attach a link to the full code, but pastebin is down, so <a href="http://pastebin.com/heGz6bAv" rel="nofollow noreferrer">here</a> is the full code for the original game without the strange black line.</p>
  
  <p><strong>EDIT</strong>: I have already tried dropping the <code>convert_alpha()</code> and adding <code>convert()</code> or even nothing at all.</p>
  
  <p><code>.convert()</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/G92my.jpg" alt="enter image description here"></p>
  
  <p><strong>NOTHING</strong>:</p>
  
  <p><img src="https://i.stack.imgur.com/chmck.jpg" alt="enter image description here"></p>
  
  <p>Why are all these black lines there, how do I get rid of them and which version (<code>convert</code>/<code>convert_alpha</code>/<strong>NOTHING</strong>) should I use (and <em>how</em> to decide which one to use).</p>