You call it Centering, I call it Code Golf
HTML5 + JavaScript (ES5), 515 bytes

That count includes the HTML tags as they are part of the program. If you only count the image processing code, it is 376 bytes including the function wrapper.

&lt;canvas id=o&gt;&lt;/canvas&gt;&lt;script&gt;f=function(p){o=new Image();o.crossOrigin='Anonymous';o.src=p;o.onload=function(){v=document.getElementById('o'),c=v.getContext('2d');v.width=l=w=o.width;v.height=t=h=o.height;c.drawImage(o,0,0);for(k=255,d=c[g='getImageData'](0,0,w,h).data,r=b=i=0;i&lt;d.length;)if((d[i++]&lt;k||d[i++]&lt;k||d[i++]&lt;k)&amp;&amp;d[i++]){x=i/4%w;y=~~(i/4/w);l=l&lt;x?l:x;t=t&lt;y?t:y;b=b&gt;y?b:y;r=r&gt;x?r:x}n=c[g](l,t,r-l+1,b-t+1);c.clearRect(0,0,w,h);c.putImageData(n,(w-r+l)/2,(h-b+t)/2)}}&lt;/script&gt;&lt;input onblur=f(this.value)&gt;


Input

A URL to an image.

Security restrictions

Because this program is running in a browser environment, only URLs to CORS-enabled images will work. Imgur is CORS enabled.

IE 10 does not support CORS. I haven't tested in IE 11 yet but it does work in Chrome and Firefox.

How to run


Type/paste in a URL into the input field.
De-focus (tab/click out of) from the input field.


Output

It outputs on the canvas on the page.

As this is a browser-based application, security restrictions prevent automatic download of a file but you can right click and save image in Chrome and Firefox. I haven't tested on IE 11 yet.

Demo

JavaScript code has been removed from the script element and put into the appropriate area to accommodate Stack Snippets:



f = function(p) {
  o = new Image();
  o.crossOrigin = 'Anonymous';
  o.src = p;
  o.onload = function() {
    v = document.getElementById('o'), c = v.getContext('2d');
    v.width = l = w = o.width;
    v.height = t = h = o.height;
    c.drawImage(o, 0, 0);
    for (k = 255, d = c[g = 'getImageData'](0, 0, w, h).data, r = b = i = 0; i &lt; d.length;)
      if ((d[i++] &lt; k || d[i++] &lt; k || d[i++] &lt; k) &amp;&amp; d[i++]) {
        x = i / 4 % w;
        y = ~~(i / 4 / w);
        l = l &lt; x ? l : x;
        t = t &lt; y ? t : y;
        b = b &gt; y ? b : y;
        r = r &gt; x ? r : x
      }
    n = c[g](l, t, r - l + 1, b - t + 1);
    c.clearRect(0, 0, w, h);
    c.putImageData(n, (w - r + l) / 2, (h - b + t) / 2)
  }
}
&lt;canvas id=o&gt;&lt;/canvas&gt;
&lt;input onblur=f(this.value)&gt;