title: Putting rect object around non-transparent pixels in PNG image
body: <p>I am writing a game which uses a tile system as a map, these tiles are all 235x256 pixels so are easy to display in a grid system. The tiles are stored as PNGs and for some of the tiles, most of the pixels are transparent.</p>
  <p><a href="https://i.stack.imgur.com/qjliC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qjliC.png" alt="enter image description here" /></a></p>
  <p>Is there a way to create a rect object around the part of the tile that has non-transparent pixels? This would be used as a collision_block which would be used in the game to determine if the player is colliding with a map block.</p>