title: How to calculate thickness of an object in PNG file using PHP GD library
body: <p>I have a PNG frame and I want to know its thickness. I am able to calculate the width/height of the image itself.</p>
  
  <pre><code>$frame = imagecreatefrompng('frame.png');
  // get frame dimentions
  $frame_width = imagesx($frame);
  $frame_height = imagesy($frame);
  </code></pre>
  
  <p>But can't figure out a way to calculate thickness of frame, please see image below so see what I mean.</p>
  
  <p><img src="https://i.stack.imgur.com/SOIj4.png" alt="enter image description here"></p>
  
  <p>Any suggestions? </p>