title: Ghostscript ps to jpg output without white space
body: <p>What I am trying to do is convert a ps which is just a image to a jpg using ghostcript here is what I started with </p>
  
  <pre><code>gswin32c.exe -sDEVICE=jpeg -sOutputFile="test.png" example.ps
  </code></pre>
  
  <p>however when I run this the jpg comes out with a lot of white space to the right and the bottom</p>
  
  <p><img src="https://i.stack.imgur.com/mF1Y8.jpg" alt="enter image description here"></p>
  
  <p>Also the picture comes out huge is there any way to crop out the whitespace in ghostscript?</p>
  
  <p>I tried this code</p>
  
  <pre><code>gswin32c.exe -sDEVICE=jpeg  -dBATCH -dNOPAUSE -dSAFER -r72x72 -g200x900 -sOutputFile="test.jpg" example.ps
  </code></pre>
  
  <p>which decrease the width but the height is still huge. Any solutions?</p>