title: Cropping away transparent pixels but preserving the offset
body: <p>I have a group of .png files where most of the image is transparent (alpha channel), but there is image in the middle (non-transparent pixels) that I need to extract.</p>
  
  <p>What I need to do is crop the image down to just the non-transparent pixels, but I need to know how many pixels were cropped off the left and bottom so when it comes time to render the cropped images, it's position can be adjusted back to were it was in the larger image.</p>
  
  <p>Is there a way to do the cropping and get the x,y offset using ImageMagick?  I know how to crop the .png file, but the location of the non-transparent image within the larger image is lost and I need this information.</p>
  
  <p>It seems I can do this using PIL and python, but getting PIL installed on a Mac is proving to be a hair pulling experience.  I've spent hours trying to get rid of the jpeg_resync_to_restart errors and it seems everyone has a different solution that worked for them, but none of them work for me... so I've given up on PIL.</p>
  
  <p>ImageMagick is already installed and working.</p>
  
  <p>Is there another set of tools I can call from a bash or python script that will do what I need?</p>
  
  <p>This isn't just a one-time operation I need to preform, so I need a script that can be run over and over when the source .png files change.</p>
  
  <p>Thanks.</p>