title: How do I automate the padding for arbitary images using MATLAB?
body: <p>This is a further question based on this answer:</p>
  
  <p><a href="https://stackoverflow.com/questions/2589851/how-can-i-implement-this-visual-effect-in-matlab/2589957#2589957">How can I implement a fisheye lens effect (barrel transformation) in MATLAB?</a></p>
  
  <p>The general solution should work for all background colors and length/width ratios.</p>