"Let's face it, aligned images are like little gifts from Heaven. Welcome, but unexpected." - Geobits
+10000 reputation to whoever wins this challenge.
Rules:
1) You are to generate a program.
2) Input will be an image, however whether it is passed as a file or a list of numbers is up to you.
3) Output will be a file which when opened in paint (or similar) will show the image aligned.
4) The canvas size will always be between 100 x 100 and 2000 x 2000 pixels. It will always be a rectangle, but not always a square.
5) No hard coding of images or funky URL magic.
6) No external libraries to be used.
Guide to Centralisation (Joshpbarron Variant)
An image will be defined as centered if the 1st white(255,255,255,>0 rgba) or transparent(x,y,z,0 rgba) on an axis is equal distance (plus or minus 1 pixel) from the edge of the canvas.
This can be achieved (and will be verified by) the following method.
1) Imagine a bounding box around the object. (Black lines added for help)
2) Move the object around until the edge of the object is equal distance from the appropriate edge of the canvas.
3) Now forget the black lines.
Input:
Output:
More inputs here.
And respective outputs here.
The +10000 rep is a lie.