text:
Will the tower balance?
Introduction
Given an ASCII tower and the force of the wind, write a program or function to determine if the tower will balance or which way it will fall.
For example the first tower balances but the second falls over toward the left.
  # #            # #
  ###            ###
 ###            ###
 # #            # #
#####          #####
 ###            ###
 ###              #

This is my first challenge. I hope you enjoy it.
Directions
The tower consists of connected blocks represented by # and forms a rigid object. Each block is a square with a width and height of one unit and has a constant density.
There are two forces that act on the tower, its weight and the wind force. All forces act on each block individually and pass through the center of the block.

Due to its weight, each block has a downward force of one unit acting on it.
Also, each block that does not have another block adjacent to it on its windward side has a force on it acting horizontally in the direction of the wind. The magnitude of this force is given as an input.
The direction of the wind is indicated by an ASCII flag somewhere in the input. There will be a flag in the input if and only if the wind is not zero. The flag does not affect any forces.

The flag will look exactly as it appears below.
Flag design and corresponding wind direction:

 o~~        ~~o
 |~~        ~~|

--->        <---

To clarify, the tower is a solid object and will not break apart and is not attached to the ground. However, your program should calculate the forces for each block individually to determine whether the tower balances.
Example
  o~~
  |~~
  # #              > >
  ###              >##
 ###              >##
 # #              > >
#####            >####
 ###              >##
 ###              >##

Wind force: 1    Wind direction: --->

The wind is blowing right and will push on the blocks shown with a > on the above right. Note that the wind acts on the inside of holes.
Assume the lower left corner of the tower has coordinates (0,0). The moment around the left base of the tower at (0,0) is 71 units clockwise so the tower will not fall left. The moment around the right base of the tower at (0,3) is 8 units clockwise so the tower will fall right.
If the wind was blowing toward the left, the respective moments would be 2 units clockwise and 61 units counterclockwise at the same points, so the tower would balance.
Input

Your program or function must take two inputs, a decimal number and a newline-separated string.
The decimal number will be greater than zero and represents the force exerted by the wind on each exposed block as in the example.
The string will represent the tower from top to bottom and may contain spaces, #|o~ characters, and newlines. You may optionally assume a trailing newline and/or pad the tower with trailing spaces to form a rectangle.
The tower will have at least one # on the bottom row.
You may input the number and string in either order.
If the magnitude of the wind force is non-zero, there will be a flag somewhere in the input, either on the ground or connected to the tower. The flag will have the exact form shown above.
The # blocks will form a connected shape that may contain holes. In other words, all blocks will be adjacent to another other block unless there is only one block.

Output

One of the characters B, L, or R, depending on whether the tower will balance, fall towards the left (counterclockwise), or fall towards the right (clockwise).
The output may have an optional trailing newline.

This is code-golf; standard rules and loopholes apply.
B Test Cases:
Wind: 1
    ~~o
    ~~|
      # #
      ###
     ###
     # #
    #####
     ###
     ###

Wind: 0
##
# ##
###

Wind: 1.7
o~~
|~~
#
##

Wind: 0.768
      o~~
      |~~
      # #
      ###
     ###
     # #
    #####
     ###
     ###

Wind: 0.1
#
#
#
#
#
# o~~
# |~~

Wind: 0
#

Wind: 0
############

Wind: 144
               o~~
############   |~~

Wind: 0
#######
 ##
 #
 ##

Wind: 0
                ############
           ############
       ############
    ############
   ############
 ############
############

Wind: 41
                 ############
            ############
        ############
     ############
    ############
  ############     ~~o
 ############      ~~|

L Test Cases:
Wind: 0
#####
   #

Wind: 42
                 ############
            ############
        ############
     ############
    ############
  ############     ~~o
 ############      ~~|

Wind: 4
########
    ###
 ~~o# ##
 ~~|#  #

Wind: 3
########
    ###
 o~~# ##
 |~~   #

R Test Cases:
Wind: 1
      o~~
      |~~
      # #
      ###
     ###
     # #
    #####
     ###
     ###

Wind: 2
o~~
|~~
#

Wind: 0.001
                 ############
            ############
        ############
     ############
    ############
  ############     o~~
 ############      |~~

Wind: 145
               o~~
############   |~~

Wind: 1
#
#
#
#
#
# o~~
# |~~

Wind: 0.26
#######
 ##
 #   o~~
 ##  |~~

Reference Solution (JavaScript)
Try it online.
function balanced(tower, wind) {
    var rows = tower.split('\n').reverse(); // Reverse so row index matches height of row.
    var height = rows.length;
    var leftEdge = rows[0].indexOf('#'); // Find bottom left corner of tower.
    var rightEdge = rows[0].lastIndexOf('#') + 1; // Find bottom right corner of tower.
    var leftMoment = 0, rightMoment = 0; // Moments around the bottoms corners of tower.
    wind *= tower.indexOf('~o')>-1 ? -1 : 1; // Find direction of the wind.

    // Sum the moments for each block in the tower.
    for (var i = height - 1; i >= 0; i--) {
        rows[i].split('').map(function(ch, index, arr) {
            if (ch=='#') {
                // If there's not a block toward the windward side of the current one.
                if ((wind < 0 && arr[index-1] != '#') || (wind > 0 && arr[index+1]!='#')) {
                    // Add moments from wind.
                    leftMoment += (i+0.5)*-wind;
                    rightMoment += (i+0.5)*-wind;
                }

                leftMoment += leftEdge - (index + 0.5);
                rightMoment += rightEdge - (index + 0.5);
            }
        }, 0);
    }
    if (leftMoment > 0) return 'L';
    else if (rightMoment < 0) return 'R';
    else return 'B';
}

Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=62673,OVERRIDE_USER=45393;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Welcome to PPCG; this is an excellently written first challenge! :)

JavaScript (ES6), 239 bytes
I golfed down my reference implementation. I was able to save bytes by changing the for loop to a map, using && and || to short-circuit if statements, and using the , operator to fit everything on one statement so as to avoid an explicit return in the function.
(a,b)=>((c=a.split`
`.reverse(),d=c[f=g=0].indexOf`#`,e=c[0].lastIndexOf`#`+1),a.match`o~`&&(b*=-1),c.map((h,i)=>h.replace(/#/g,(j,k,l)=>(b>0&l[k-1]!='#'|b<0&l[k+1]!='#'&&(f+=(i+=0.5)*b,g+=i*b),f+=d-k-0.5,g+=e-k-0.5))),f>0?'L':g<0?'R':'B')

It might still be possible to golf this more. Suggestions are welcome.

+1 much better than my naïve solution

JavaScript ES6, 297 293 bytes
Basically a compressed version of the given implementation.
b=(n,e)=>{r=n.split`
`.reverse(),t=r.length,a=r[0].indexOf`#`,f=r[i=l=0].lastIndexOf`#`+1;e*=n.indexOf`~o`>-1?-1:1;for(d=t-1;d>=0;d--)r[d].split``.map((n,r,t)=>{(j="#")==n&&((0>e&&j!=t[r-1]||e>0&&j!=t[r+1])&&(i+=(d+.5)*-e,l+=(d+.5)*-e),i+=a-(r+.5),l+=f-(r+.5))},0);return i>0?"L":0>l?"R":"B"}

Semi-expanded:
b = (n, e) => {
    r = n.split `
`.reverse(), t = r.length, a = r[0].indexOf `#`, f = r[i = l = 0].lastIndexOf `#` + 1;
    e *= n.indexOf `~o` > -1 ? -1 : 1;
    for (d = t - 1; d >= 0; d--) r[d].split ``.map((n, r, t) => {
        (j = "#") == n && ((0 > e && j != t[r - 1] || e > 0 && j != t[r + 1]) && (i += (d + .5) * -e, l += (d + .5) * -e), i += a - (r + .5), l += f - (r + .5))
    }, 0);
    return i > 0 ? "L" : 0 > l ? "R" : "B"
}


text:
Sort the pixels
Your task is to create a program that will, given an input image, create an output image of the same size, where all pixels are ordered by hex value.
Your program may:

Sort the pixels from left to right and then down or first sort down in columns and then right. In any case, the top left pixel is the smallest, and the bottom right is the largest.
Use transparency, but this is not required.
Sort by RGB, but you may use CMY, or any other format with at least 3 values. You can choose what values to sort on. (HSV may give some nice images)
Use any well-known image format that most computers can open.

Rules:

Output must be written to disk or be pipeable to a file.
Input is given as a commandline argument, in the form of a relative path to the image, or piped in from the commandline.
This is code golf, so shortest code in bytes wins!

Related.

Pyth - 10 bytes
Reads image, collapses bitmap, sorts, and then splits up bitmap again, then writes.
.wclK'zSsK

Doesn't work online for obvious reasons. Takes input as relative path to image file and outputs into o.png.
Output from American Gothic:

I hope I'm not the only one to have the impression that the picture is moving...

It looks like wood.

JavaScript (ES6), 383 377 354 bytes
f=s=>{d=document,i=new Image,i.src=s,i.onload=$=>{c=d.createElement`canvas`,x=c.getContext`2d`,c.width=w=i.width,c.height=h=i.height,x.drawImage(i,0,0),D=x.getImageData(0,0,w,h),t=D.data,t.set([].concat(...[...t].map((v,i,T)=>i%4?[,,,0]:T.slice(i,i+4)).sort((a,b)=>a.some((v,i)=>k=v-b[i])&&k)).slice(12*w*h)),x.putImageData(D,0,0),d.body.appendChild(c)}}

Runnable demo:

f=function(s) {l=[i=new Image].slice,i.crossOrigin="anonymous",i.src=s,i.onload=function($){d=document,c=d.createElement`canvas`,c.width=w=i.width,c.height=h=i.height,x=c.getContext`2d`,x.drawImage(i,0,0),D=x.getImageData(0,0,w,h),t=D.data,t.set([].concat.apply([],l.call(t).map((v,i)=>i%4?[0,0,0,0]:l.call(t,i,i+4)).sort((a,b)=>a.reduce((A,v,i)=>A||v-b[i],0))).slice(3*t.length)),x.putImageData(D,0,0),d.body.appendChild(c)}}
$("img").click(function() { f(this.src); })
canvas { padding-right: 4px; } img { cursor: pointer; }

How this code works is to use getImageData to get an array of the form
[R,G,B,A,
 R,G,B,A,
 R,G,B,A,
 ...]

And map it to an array of the form
[[R,G,B,A],[0,0,0,0],[0,0,0,0],[0,0,0,0],
 [R,G,B,A],[0,0,0,0],[0,0,0,0],[0,0,0,0],
 [R,G,B,A],[0,0,0,0],[0,0,0,0],[0,0,0,0],
 ...]

So that the R values are mapped to arrays of the RGBA set, and the B, G, and A values turn into minimum-value zero arrays. When we sort this array, all the [0,0,0,0] arrays sort to the bottom and the real-value arrays sort normally at the top:
[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],
 [0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],
 [0,0,0,0],..., [R,G,B,A],[R,G,B,A],[R,G,B,A],...]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
               extract & flatten these sorted pixels

We skim the top fourth of the array (to lose the empty values we created), flatten it with [].concat.apply, and end up with an array of the first form again, but this time, it's sorted.
Slightly de-golfed with whitespace and comments:
f=s=>{
  // first, load image, then do everything else onload
  i=new Image,
  i.src = s,
  i.onload=$=>{
    // set up the canvas
    d=document,
    c=d.createElement`canvas`,
    w=c.width=i.width,
    h=c.height=i.height,
    x=c.getContext`2d`,

    // draw image to canvas and capture pixel data
    x.drawImage(i,0,0),
    D=x.getImageData(0,0,w,h),
    t=D.data,

    // set pixel data to...
    t.set(
      // the flattened array...
      [].concat(...
        // that is a mapping of the pixel data...
        [...t].map(
          // that clumps RGBA families into subarrays
          // by replacing every fourth value with [R,G,B,A]
          // and all other values to [0,0,0,0]...
          (v,i,T)=>i%4?[,,,0]:T.slice(i,i+4)
        )
        // and is then sorted...
        .sort(
          // by reducing each array to a positive, negative, or zero
          // by comparing R,G,B,& A until the first nonzero difference
          (a,b)=>a.some((v,i)=>k=v-b[i])&&k
        )
      )
      // then eliminate the low-sorted empty [0,0,0,0] values we created,
      // leaving only the top fourth, with real values
      // (note that 3*4*w*h is the same as 3*t.length)
      .slice(3*4*w*h)
    ),

    // now that `t` is set, store `D` in canvas
    x.putImageData(D,0,0),

    // show canvas
    d.body.appendChild(c)
  }
}

Note that most browsers may fail to run this code for large images, because it passes a huge number of arguments into [].concat. When the browser environment does not allow sufficient memory for all the arguments, an alternative approach is to re-map the RGBA values out of the top fourth arrays back onto the array, for a total score of 361 bytes:
f=s=>{d=document,i=new Image,i.src=s,i.onload=$=>{c=d.createElement`canvas`,x=c.getContext`2d`,c.width=w=i.width,c.height=h=i.height,x.drawImage(i,0,0),D=x.getImageData(0,0,w,h),t=D.data,t.set([...t].map((v,i,T)=>i%4?[,,,0]:T.slice(i,i+4)).sort((a,b)=>a.some((v,i)=>k=v-b[i])&&k).map((v,i,A)=>A[3*w*h+(i>>2)][i%4])),x.putImageData(D,0,0),d.body.appendChild(c)}}

We simply replace the [].concat(...{stuff}).slice(12*w*h) with {stuff}.map((v,i,A)=>A[3*w*h+(i>>2)][i%4]).)

Could you include an example output?

@PaŭloEbermann Done.

@insertusernamehere Oh, dang, I only tested on small images. My concat.apply call is supplying too many arguments to concat and the JS engine is rejecting it. D: Thanks! I'll fix that and note the two scores. (And I'm glad I could help!)

@insertusernamehere Thanks for the head-up about the size limitation; I've now also published a slightly longer version that works on larger images.

@apsillers Nice work. Can't upvote again unfortunately. :)

Mathematica 86 83    72 bytes
 f=Flatten;Image[f[Sort[f[s=ImageData@#1,1]]]~ArrayReshape~Dimensions@s]&

With 14 bytes saved thanks to @Martin Buttner.

Example
The image itself is input.  Alternatively, a variable containing the image could be used.

The challenge specifies that pixels be sorted by hex value, but if I read this correctly, you use Mathematica's default sort for {R,G,B} or {R,G,B,alpha} lists. It's not clear to me that these are equivalent.

@MichaelStern I don't know Mathematica, but if it sorts tuples elementwise  like most languages, they are equivalent: Numbers like hex are sorted by each digit, two of which are represented by each element in the tuple.

@MichaelStern, Maltysen is correct. The RGB sort and the Hex sort are equivalent: sorting by the R, then the G, then the B value works just like the place value sort in Hex.

OK, +1 from me.

ImageData and ArrayReshape could use infix notation. Flatten is long enough to save a couple of bytes by assigning it to f. And do you actually need "Byte"? Wouldn't the default just scale the channel values to [0,1] such that the sorting and image reconstruction would still work just fine?

Great suggestions, Martin, especially the one about "Byte".  I had early tried eliminating "Byte" but only did it in one of the usages. Both instances of "Byte" had to be removed to make it work.

C (using SDL1.2), 333 322 315 bytes
C is most probably not the 'sharpest knife in the shelf' for this kind of work, I wanted to give it a try anyway. Tips for improving my answer are welcome. The program gets the name of the input image file as a cli argument.
#include <SDL.h>
#include <SDL_image.h>
#define X SDL_Surface*
#define Y const void*
C(Y a,Y b){return*(Uint32*)a-*(Uint32*)b;}main(int o,char**a){X i=IMG_Load(a[1]);X s=SDL_SetVideoMode(i->w,i->h,32,0);i=SDL_ConvertSurface(i,s->format,0);qsort(i->pixels,i->w*i->h,4,C);SDL_BlitSurface(i,0,s,0);for(;;SDL_Flip(s));}

compile and run : gcc -I/usr/include/SDL snippet.c -lSDL -lSDL_image && ./a.out

I don't usually golf in C, but I've just answered this challenge yesterday and I just wanted to continue playing with that new toy :)
thanks to @pseudonym117 for helping me saving 5 bytes

Can save 1 byte by changing your while at the end to for(;;SDL_Flip(s));, and I believe you can omit int on the method C and save 4 more.

Javascript ES6, 334 bytes
f=s=>{with((d=document).body.appendChild(c=d.createElement`canvas`).getContext`2d`)(i=new Image).src=s,drawImage(i,0,0,w=c.width=i.width,h=c.height=i.height),t=(g=getImageData(0,0,w,h)).data,t.set([...t].map(i=>(0+i.toString(16)).slice(-2)).join``.match(/.{8}/g).sort().join``.match(/../g).map(i=>parseInt(i,16))),putImageData(g,0,0)}

Ungolfed:
f=s=>{                                   // create function that accepts image name
 with((d=document).body.appendChild(     // use "with" to exclude having to prepend "<context2d>." to drawImage, getImageData and putImageData
   c=d.createElement`canvas`).getContext`2d`) // create canvas to get pixels from and draw output to
  (i=new Image).src=s,                   // create image, define source filename
  drawImage(i,0,0,w=c.width=i.width,     // draw image to canvas
                  h=c.height=i.height),
  t=(g=getImageData(0,0,w,h)).data,      // get image data from canvas in form of Uint8Array
  t.set([...t]                           // convert image data from Uint8Array to standard array
   .map(i=>(0+i.toString(16)).slice(-2)) // convert R,G,B,A bytes to base16 strings with leading zeros
   .join``.match(/.{8}/g)                // convert array of [R,G,B,A,R,G,B,A,...] to [RGBA,RGBA,...]
   .sort()                               // sort pixel values
   .join``.match(/../g)                  // convert array of [RGBA,RGBA,...] to [R,G,B,A,R,G,B,A,...]
   .map(i=>parseInt(i,16))),             // convert hex strings back to integers, reassign to image data
  putImageData(g,0,0)                    // dump image data onto canvas
}

@insertusernamehere It works on the latest Firefox. Like your answer, it assumes there is a body to append the canvas to and that the source image is from the same domain.

+1 Very sleek solution. It also processes images up to 1600 x 1900px.

Today I learned that appendChild returns its argument. Very useful! You inspired me to whittle down my entry from 377 to 354, but I can't quite beat yours :). (When I use your appendChild-chaining and with technique I can get it down to 347, but still 13 away!) Excellent work!

JavaScript (ES6), 452 480 484 487 511 bytes
Wow, this got longer than expected:
f=u=>{i=new Image;i.src=u;i.onload=_=>{c=(d=document).createElement`canvas`;c.width=w=i.width;c.height=h=i.height;x=c.getContext`2d`;x.drawImage(i,0,0,w,h);p=x.getImageData(0,0,w,h).data;t=[];f=[];for(j=0;j
a[0]>b[0]||a[0]==b[0]&&a[1]>b[1]||a[0]==b[0]&&a[1]==b[1]&&a[2]>b[2]).map(u=>f.push.apply(f,u));x.putImageData(new ImageData(new Uint8ClampedArray(f),w,h),0,0);d.body.appendChild(c)}}

The function takes an URL as its input f('test.jpg'); and draws the result into a canvas-element which is appended to the body.
Note that the source must be on the same domain or the script will halt with a security issue.

Limitations
I've tested it in Firefox 42 on OS X (10.10) on a machine with 2.5 GHz i7 and 16 GB RAM. The maximum image size I could process without Firefox asking to continue the script execution was 1600 x 1932 px.

Ungolfed
f = u => {
    i = new Image;
    i.src = u;
    i.onload = _ => {
        c = (d = document).createElement`canvas`;
        c.width = w = i.width;
        c.height = h = i.height;

        x = c.getContext`2d`;
        x.drawImage(i, 0, 0, w, h);

        p = x.getImageData(0, 0, w, h).data;

        t = [];
        f = [];

        for (j = 0; j
 a[0] > b[0] || a[0] == b[0] && a[1] > b[1] || a[0] == b[0] && a[1] == b[1] && a[2] > b[2] )
         .map(u => f.push.apply(f,u));

        x.putImageData( new ImageData( new Uint8ClampedArray(f), w, h), 0, 0);
        d.body.appendChild(c)
    }
}

Output
For a better comparison I also took the "American Gothic" as the example source:

Edits

Saved 24 bytes by using for (a in b) instead of for(;;). Thanks to ar34z
Saved 3 bytes by storing document in a variable.
Saved 4 bytes by dropping some of these ().
Saved 10 bytes by using tagged template strings, omitting the () on object creation and removing another pair of redundant (). Thanks to apsillers.
Saved 14 bytes by massive refactoring of the code that flattens the color array after sorting. Thanks a lot to apsillers and Ypnypn for undercutting each other.
Saved 1 byte by refactoring the for-loop that gets the colors of each pixel.

You can minimise the for-loops using for(k in t) which will save a few more bytes :)

Nice work! Some improvements: lose the () in new Image(); use tagged template strings for your string arguments (createElement\canvas`, getContext`2d`), don't use parentheses for single arrow functions parameters (just do f=u=>{...}; parens are only for multi-parameter or zero-parameter arrow funcs). Also you might have one or two single-statement for` loops that have brackets, which aren't necessary.

Oh, actually, for zero-argument arrow funcs, use a single-character dummy argument instead of two-char empty parens. (i.onload=$=>... instead of i.onload=()=>...)

I think for(l in u)f.push(u[l]); can become for(z of u)f.push(z);

@Ypnypn It can be even shorter than that :). --  for(u of t)for(z of u)f.push(z) is pretty dang short, but it can be shortened further to t.map(u=>u.map(z=>f.push(z))). In a lot of cases, using .map or .some with an arrow function is going to be shorter than using a for loop. If you want to go really crazy, you can save even more here with t.map(u=>f.push.apply(f,u)); which says "For every array u in t, supply u as a list of arguments to f.push via apply (since push can accept an unbounded number of arguments and it pushes all of them in order).

@apsillers Thanks. And thanks a lot for you helpful tips. Today I learnt. Didn't know about tagged template stings before. That's pretty cool.

@Ypnypn Thanks for the suggestions. Using for(z of u) was a pretty nice idea.

Bash + GNU utils, 80
s()(sed 1d $1|cut -d\  -f$2)
sed 1q $1
s $1 2-|sort -t_ -k1.16|paste <(s $1 1) -

This assumes input/output format is in ImageMagick pixel enumeration .txt format.  The input is passed as a filename and the output goes to STDOUT.

If the above is not considered a well-known image format, then we can add in the necessary conversions:
Bash + GNU utils + ImageMagick, 108
s()(sed 1d t|cut -d\  -f$1)
convert $1 txt:t
(sed 1q t
s 2-|sort -t_ -k1.16|paste <(s 1) -)|convert txt:- $2

Input and output are specified as filenames.  ImageMagick determines what file formats to use by the passed file extensions, so we can use any common ones:
$ ./sortpixels.sh 398px-Grant_Wood_-_American_Gothic_-_Google_Art_Project.jpg o.png
$

The resulting o.png looks like:

Java, 316 bytes
import javax.imageio.*;class C{public static void main(String[]a)throws Exception{java.awt.image.BufferedImage i=ImageIO.read(new java.io.File(a[0]));int w=i.getWidth(),h=i.getHeight(),v[]=i.getRGB(0,0,w,h,null,0,w);java.util.Arrays.sort(v);i.setRGB(0,0,w,h,v,0,w);ImageIO.write(i,"png",new java.io.File("a.png"));}}

Places the hexadecimal values of the pixel colors in an array. The array is sorted, and the colors are remapped to the pixels in the image. The name of the resulting image is a.png.

Python 2, 128 bytes
from PIL import*
a=Image.open('a')
b=a.load()
c,d=a.size
a.putdata(sorted(b[e,f]for f in range(d)for e in range(c)))
a.save('b')

Provided the image is a file named a with no extension, the output will be a file named b with no extension.

I haven't checked, but you should be able to do something along the lines of a.putdata(sorted(b[f/c,f%d]for f in range(d*c))) instead (I just woke up, so I may have mixed up the variables).

As you wrote it, it didn't work (index out of range), but I haven't tried switching around any variables (I don't have much time at the moment). @Shebang

SmileBASIC, 39 35 bytes
Assuming the image is loaded onto the 512*512 graphics page:
DIM A[0]GSAVE A,0SORT A
GLOAD A,0,1

Explained:
DIM IMG[0] 'create array
GSAVE IMG,0 'save graphics to array
SORT IMG 'sort
GLOAD IMG,0,1 'load graphics from array

It's that simple!
Unfortunately we have to use integers, which adds 4 bytes to the program size due to the type suffixes.

I'm not really sure why ints are required. It seems like using floats actually gets the results correct. Running this code using ints on SYS/DEFSP.GRP puts a FF000000 in the top left and a 00101010 in the bottom right, which is the apparent opposite of the question. Using floats puts 00000000 in the top left and FFF8F8F8 in the bottom right, which is correct. (Of course, this treats the hex colors as unsigned/higher channel greater, which is probably correct.)

I think that's valid, since the question doesn't specify a specific order to sort by (and since the values are signed, 0xFF000000 is smaller than 0x00101010) but anyway, I'm not actually sure why I used integers here... I think at the time I didn't understand how GLOAD used unsigned values when you used a float array, and just assumed it didn't work.

Java, 424 417 404 bytes
Well, this is not a language you want to golf in...
import java.awt.image.*;import java.io.*;import javax.imageio.*;class F{public static void main(String[]x)throws Exception{BufferedImage i,o;i=ImageIO.read(new File(x[0]));o=new BufferedImage(i.getWidth(),i.getHeight(),BufferedImage.TYPE_INT_RGB);o.setData(i.getRaster());int[]p=((DataBufferInt)o.getRaster().getDataBuffer()).getData();java.util.Arrays.sort(p);ImageIO.write(o,"png",new File("o.png"));}}

C#, 497 bytes
First time post, first golf. Clearly not the best for golfing
Not really respecting the piping.
Takes an image path as an input and outputs it with letter "o" prepend to the name.
Works better with bitmaps, odds results with others
using System.Linq;using System.Drawing;using System.Runtime.InteropServices;class Program{static void Main(string[]args){using(var im=(Bitmap)Image.FromFile(args[0])){int h=im.Height;int w=im.Width;var b=im.LockBits(new Rectangle(0,0,w,h),System.Drawing.Imaging.ImageLockMode.ReadWrite,System.Drawing.Imaging.PixelFormat.Format32bppRgb);var p=new int[h*w];Marshal.Copy(b.Scan0,p,0,h*w);var q=p.ToList();q.Sort();p=q.ToArray();Marshal.Copy(p,0,b.Scan0,h*w);im.UnlockBits(b);im.Save("o"+args[0]);}}}

Haskell, 195 bytes
import Data.List
import Graphics.GD
f p=do
 a<-loadPngFile p;(x,y)<-imageSize a;let l=[(i,j)|j<-[0..y],i<-[0..x]]
 mapM(flip getPixel a)l>>=mapM(\(d,c)->setPixel d c a).zip l.sort;savePngFile"o"a

This uses the GD library. Usage f <filename>. The input file must be in png format. The output file is named o.
How it works: straightforward, i.e. read the picture, walk over all coordinates and get the pixels, sort the pixels, walk over the coordinates again, but this time set the pixels in the order they appear in the sorted list, write the file to disk.

Java + Processing, 198 bytes
PImage p;void settings(){p=loadImage("peter-olexa-Ejgx4k3iryg-unsplash.jpg");size(p.width,p.height);}void setup(){p.loadPixels();p.pixels=sort(p.pixels);p.updatePixels();image(p,0,0);save("2.jpg");}

Outputs image as 1.jpg.

Funky2, 156 Bytes
I=draw.newImageData(arg[1)C=[]j=i=0I.mapPixels((x,y,r)=>C[i++]=r)C=C:sort((a,b)=>(a.r*256+a.g+a.b/256)-(b.r*256+b.g+b.b/256))I.mapPixels(@C[j++)I.export"o"

Non-Competing due to the fact that several features were implemented in response to this challenge, including image exporting and list sorting. Also several features needed fixing.
Ungolfed
I = draw.newImageData(arg[1]); $// Load the specified image as a bitmap.
c = []; $// Generate a table for us to pour colours into.
j=i=0;  $// Initialize two counters, I and J. Saves us resetting i, and c[#c] is prohibitively memory intensive
I.mapPixels((x,y,r)=>c[i++]=r); $// Iterate over the image and assign each colour (Contained as a list in r) into c.
c = c:sort((a,b)=>(a.r*256+a.g+a.b/256)-(b.r*256+b.g+b.b/256)); $// Sort C by R, then G, then B.
I.mapPixels(@c[j++]); $// Map back over I, replacing each colour with their index in C
I.export"o"; $// Export as "o"

There are a couple of opportunities for improvement; such as using c[#c] rather than c[i++] or Sorting c every time I try to index it in the second mapping; but these methods cause the execution time to skyrocket.
Output, American Gothic

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Convert Valve KV into JSON
Valve's KV file format is as follows (in pseudo-EBNF):
<pair> ::= <text> <value>
<value> ::= <text> | <block>
<text> ::= "\"" <char>* "\""
<block> ::= "{" <pair>* "}"

The parsing starts on <pair> state. Whitespace is allowed anywhere, but is only required between two consecutive <text> tokens ("a""b" is invalid, but "a" "b" is valid, and so is "a"{}).
And since I'm lazy, <char> is any character, except ", unless preceded by \.
You can also see KV as JSON without commas and colons, and with only strings and objects as possible types.
Your task is to write a program or function that converts a input string (stdin, file or argument) in KV to a output string in JSON. You can output anywhere (stdout, file or return value), as long as it's a valid json string.
It isn't necessary to preserve whitespace in the output, as long as quoted text doesn't change.
Standard loopholes apply, of course.
Bonus
You get a -20 byte bonus if the output is pretty-printed, regardless of input. Pretty printed means indenting each level of blocks with 4 spaces, separating colons from values by 1 space and have one pair per line. Closing braces should stand on their own line.
Test cases
Input:
"foo" {
    "bar" "baz"
    "oof" {
        "rab" "zab"
    }
}

Output:
{
    "foo": {
        "bar": "baz",
        "oof": {
            "rab": "zab"
        }
    }
}

Input:
"obj" {
    "emptyo" {}
    "troll" "}{"
}

Output:
{
    "obj": {
        "emptyo": {},
        "troll": "}{"
    }
}

Input:
"newline" "
"

Output:
{
    "newline": "\n"
}

Input:
"key
with_newline" {
    "\"escaped\"quotes" "escaped_end\""
}

Output:
{
    "key\nwith_newline": {
        "\"escaped\"quotes": "escaped_end\""
    }
}

In terms of the EBNF, what does the entire input need to be?

@feersum Sorry. It starts on <pair>. Edited question.

Can we assume that all tokes are separated by at least one whitespace?

@feersum No. You can assume a space only between two <text>s. "a"{} is valid, "a""b" isn't, but "a" "b" is. Should I include whitespace on the EBNF?

I think it's better to leave the EBNF uncluttered and state the whitespace rules elsewhere.

If was going to submit import json,vdf;lambda x:json.dumps(vdf.parse(x),indent=4) (Python 2, 58 bytes before bonus), but vdf requires brackets to be on their own line. It also reorders the dictionaries, and I'm not sure if this is allowed.

In your pseudo BNF, it seems that text can contain exactly 1 char

It's important to note that certain characters must be escaped in JSON strings. Since they aren't escaped in your KV format (I don't know whether your comment about laziness means that they are in the original KV spec), it's important to have some test cases which cover them.

Also, your spec forces text to contain exactly one char, but all of your examples have texts with multiple chars. What should the spec say? 0 or more chars? 1 or more chars?

@PeterTaylor That`s correct, edited the question. Also, thanks for the edit.

So, when you say any character, do you mean Unicode, ASCII, printable ASCII and newlines, or something else?

Also, you might want to include some test cases that involve backslashes and escaped double quotes.

@Dennis Regarding definition of character: Whatever your language supports. I'll add some escaping cases.

OK, the last test cases is completely different from how vdf behaves (it doesn't allow newlines in keys and \" is a backash and a quote). Before I rewrite my code once again, can backslashes escape anything else, including themselves? What should the output of "\n\N" "\\" be?

@Dennis It is different from the usual, yes. I thought this made it simpler as a challenge, since you don't need extra rules. Can you edit the post to explain backslashes? I think I'd make it too confusing. ("\n\N" "\\" => {"\n\N": "\\"}, so yes it escapes newlines and quotes, but can be escaped too)

What do you mean by Can you edit the post to explain backslashes??

CJam, 57 54 bytes
{[~]2/{`_'{#{1>W<"\u%04x"fe%s`}{~J}?}f%':f*',*{}s\*}:J

This is a named function that pops a VDF string from the stack and pushes a JSON string in return.
CJam has no JSON built-ins, so the bonus won't be worth it. Since conditionally escaping some characters would be a pain for the same reason, I decided to escape everything.
The result isn't pretty, but it's valid JSON. Try it online in the CJam interpreter.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Quine multiple times
Your task is make program that do following:

You should take number. (Positive, negative, fraction is possible input)
If it is negative, you reverse the quine. and negate that number (Become positive)
Then you repeat <integer part of the input number> times and print first <floor(fraction part of the input number*length)> from your source program. If it is integer, then the fraction part is zero.

-10% bonus if your program isn't palindrome.
Example
If your program is "ABCDEFG", then
1.
5
ABCDEFGABCDEFGABCDEFGABCDEFGABCDEFG

Explanation

ABCDEFG five times

2.
-2
GFEDCBAGFEDCBA

Explanation

GFEDCBA (reversed ABCDEFG) 2 times

3.
7.5
ABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABC

Explanation

ABCDEFG 7 times followed by ABC (first 3(floor(0.5*7)=floor(3.5)=3) letter on ABCDEFG)

4.
-0.3
GF

Explanation

GFEDCBA (reversed ABCDEFG) 0 times followed by GF (first 2(floor(0.3*7)=floor(2.1)=2) letter on GFEDCBA(reversed ABCDEFG))

5.
0
<empty>

Explanation:

<empty> here means that your program doesn't output. It is ABCDEFG zero times that is defined as empty string.

Could you please clarify on the instructions?

Related.

@LegionMammal978 I'm actually bad at expressing thing, but I hope it will make it clearer.

What if a programming language has neither fractions nor negative numbers?

@mbomb007 I guess you can parse the string yourself and handle - and . manually (representing the fraction as positive integers). Or you can turn your attention to the next challenge. ;) (Not every language can participate in every challenge, but as long as the challenge doesn't deliberately rule out arbitrary individual languages, that's completely fine. Just think of all of the audio/image processing or file system challenges.)

@MartinBüttner Yeah, I'm not doing one of those in BF, lol.

It would have felt more logical to give a 10% bonus to programs which are palindromes

I'm guessing the answer is no, but is a trailing newline allowed?

Is the quine allowed to read its own source code?

@ןnɟuɐɯɹɐןoɯ That's called a cheating quine, which is by definition not actually a quine.

@ThisSuitIsBlackNot Nevertheless, it is a quine (albeit a cheating one). My question was if this kind of quine was allowed, because the specs don't address this.

@ןnɟuɐɯɹɐןoɯ No, it is not a quine. The term "cheating quine" is a misnomer. A quine is a program that takes no input (including reading from files). A program that reads its own source code is not a quine.

@ןnɟuɐɯɹɐןoɯ Although now that I think about it, a program that prints its own source code in reverse probably isn't a quine, either, technically speaking. :P

@Bas You're right, and I regret it, however, the milk has been spilt.

CJam, 28 26 bytes * 0.9 = 23.4
Thanks to Sp3000 for saving 2 bytes.
{`"_~"+rd_z26*,\g1|@%f=}_~

Test it here.
Explanation
{`"_~"+ e# Generalised quine framework. Leaves the source code on the stack.
  rd    e# Read input and parse as double.
  _z    e# Copy and get absolute value.
  26*   e# Multiply by 26, the length of the quine to get length N of the output.
  ,     e# Get a range [0 1 ... floor(N-1)].
  \g    e# Swap with other copy and computer signum to determine direction of string.
  1|    e# This might be zero though, so take bitwise OR with 1 to avoid an error.
  @%    e# Pull up source string. Reverse it if the signum was -1 (no-op otherwise).
  f=    e# The range we pushed earlier corresponds to the (cyclic) indices of the source
        e# which make up the desired result, so we map each index to the corresponding
        e# character to get the final result.
}_~

Vitsy, 34 * 0.9 = 30.6 Bytes
Thanks to @Sp3000 for pointing out a flaw in my code!
Woo. My Physics teacher reminded me I had power functions to help me with this. Go figure.
'r(;Vd3*V2^12/^DvV/1+(rvl1-*\[DO{]
'                                   Start recording as a string - this grabs everything and pushes it to the stack as a string.
 r                                  Reverse the stack order.
  (;                                If the top item is zero, exit the program.
    V                               Grab the input as a final global variable.
     d3*                            Push the character ' to the stack.
        V2^12/^                     Get the absolute value of the input value.
               Dv                   Duplicate and save in a temp variable.
                 V                  Push the global variable to the stack.
                  /                 Divide the top two items - this gets -1 or 1 depending on the polarity of the input.
                   1+(              If it's -1, do the next instruction. Otherwise, don't.
                      r             Reverse the stack
                       v            Push the temporary variable to the stack.
                        l1-*        Multiply by the length of the stack minus 1.
                            \[   ]  Repeat everything in brackets top item of the stack times.
                              DO{   Duplicate an item, pop it off the stack and output it, then move one item over in the stack.

Perl, 104 bytes - 10% = 93.6
perl -i-0.3 -e '$_=q{$_="\$_=q{$_};eval";$_=reverse if$^I<0;$n=abs$^I;print+($_ x$n).substr$_,0,y///c*($n-int$n)};eval'

102 bytes + 2 bytes for -i - 10% for not being a palindrome. Input is passed as the argument to -i (e.g. -0.3 above).
How it works
This solution is based on the following quine:
$_=q{print"\$_=q{$_};eval"};eval

This works as follows. First, set $_ to the string:
print"\$_=q{$_};eval"

Next, call eval, which works on $_ by default. This calls print with one argument, a string literal:
"\$_=q{$_};eval"

Since this string is double-quoted, variables are interpolated. After interpolating $_, the value of the string is:
\$_=q{print"\$_=q{$_};eval"};eval

When printed, this outputs:
$_=q{print"\$_=q{$_};eval"};eval

which is the source code of the program itself.
The nice thing about this quine is that you can embed arbitrary code inside the string to be eval'd.

Here's a breakdown of the full solution:
perl -i-0.3 -e'
    $_=q{                     # string to be eval'd
        $_="\$_=q{$_};eval";  # append beginning and end of quine so the
                              #  entire thing can be reversed if necessary
        $_=reverse if $^I<0;  # reverse if input < 0
        $n=abs $^I;           # set $n to absolute value of input
        print                 # print
            +($_ x $n)        # $_ repeated $n times
            .                 # concatenated with
            substr $_,        # substring of $_
                   0,         # starting at the beginning
                   y///c      # having length x, where x is length of $_
                   *          # multiplied by
                   ($n-int$n) # fractional part of $n
    };
    eval                      # eval $_
'

Mathematica, 139 - 10% = 125.1 bytes
StringJoin[Table[s = If[#1 > 0, #1 & , StringReverse][ToString[#0, InputForm]], {Abs[Floor[#1]]}], StringTake[s, Floor[Mod[#1, 1]*139]]] &

Note the trailing space. The whitespace, standard notation, etc. are the result of the ToString[#0, InputForm].

Haskell, 158 * 0.9 = 142.2 bytes
c i|i<0=reverse|1<2=id;f i=putStr$take(floor$abs i*158)$cycle$c i$s++show s;s="c i|i<0=reverse|1<2=id;f i=putStr$take(floor$abs i*158)$cycle$c i$s++show s;s="

A quine function.
*Main> f (-0.3)
"=s;s wohs++s$i c$elcyc$)851*i sba$roolf(ekat$r

*Main> f 1.1
c i|i<0=reverse|1<2=id;f i=putStr$take(floor$abs i*158)$cycle$c i$s++show s;s="c i|i<0=reverse|1<2=id;f i=putStr$take(floor$abs i*158)$cycle$c i$s++show s;s="c i|i<0=reverse

*Main> f 0
              <-- empty

Python 2, 193 bytes - 10% = 173.7
x=input();y=int(x);_='x=input();y=int(x);_=%r;_=(_%%_)[::y/abs(y)];x,y=abs(x),abs(y);_=_*y+_[:int(y*(x-y)*193)];print _';_=(_%_)[::y/abs(y)];x,y=abs(x),abs(y);_=_*y+_[:int(y*(x-y)*193)];print _

Errors out on 0, but, ignoring STDERR, you still get empty output.

Right now this is the longest solution, but try find a shorter one, and reply if you can.


text:
Biplex: an important useless operator
Input

A list of between 1 and 255 positive integers (inclusive), each in the range 1 to 232 - 1 (inclusive).
Your input format does not need to be identical to the test cases.
Input without leading zeroes is required to be accepted.
Input with leading zeroes is not required to be accepted.
You may use whatever delimiter you wish between the integers.
An integer may be represented by a string but the individual digits of a specific integer must be contiguous.
You may choose to use any base for the input (including binary and unary), provided the output is also in that base.

Output

A single integer.
The output must have no leading zeroes.
The output must be in the same base as the input.
The output can be calculated in whatever way you wish but must match the result of the following calculation:

Calculating biplex

The bits of a binary representation are numbered from the right starting from zero, so bit i is in the column representing 2i.
The i th bitsum is the sum of the i th bits of the binary representations of each of the input numbers.
The bitsum maximum is the highest value taken by the bitsums.
The bitsum minimum is the lowest non-zero value taken by the bitsums.
The i th digit of the binary representation of the output is:

1 if the i th bitsum is equal to the bitsum maximum or the bitsum minimum.
0 otherwise.

Worked example
This example uses binary for input and output.
Input:    100110
         1101110
         1100101
         _______
Bitsums: 2301321

Output:   101101

The bitsum maximum is 3 and the bitsum minimum is 1, so the output has 1s everywhere that the bitsum is 3 or 1, and 0s everywhere else.

Test cases
Test cases are in the form:
Input => Output

The test cases in binary:
[1] => 1
[10] => 10
[1, 10, 101] => 111
[11111111111111111111111111111111] => 11111111111111111111111111111111
[10010010010010010010010010010010, 10101010101010101010101010101010, 11011011011011011011011011011011] => 11100011100011100011100011100011
[10001011100010100110100101001001, 10110000111110010000111110111010, 1101110001101101011010010100101, 1010101010001011101001001010101] => 11

The same test cases in decimal:
[1] => 1
[2] => 2
[1, 2, 5] => 7
[4294967295] => 4294967295
[2454267026, 2863311530, 3681400539] => 3817748707
[2341103945, 2969112506, 1849078949, 1430639189] => 3

Leaderboard
Thanks to Martin's Leaderboard Snippet

var QUESTION_ID=62713,OVERRIDE_USER=8478;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

The operator was named biplex, short for binary plane extrema, following discussion in chat.

Can we require the input to be in binary, as in the example?

@feersum You may choose to use any base for input and output (including binary and unary), provided they are both in the same base. So yes, go for it :)

Can we use notation like [[1,0,1],[1,1,0,0],[1,0,0,1]]?

Probably not. Assume the most restrictive one.

@ChristianIrwan The input should be in the form of integers (each made up of contiguous digits). An integer can be represented as a string but there should be no separators between the digits.

@trichoplax But you say you can input in binary, right?

@ChristianIrwan yes, provided the output is in the same base as the input.

Jelly
14 bytes
BUSµḟ0Ṣ.ịe€@UḄ

Try it online!
How it works
BUSµḟ0Ṣ.ịe€@UḄ    Main link. Input: A (list)

B                 Convert each item in A to binary.
 U                Reverse each array of binary digits.
  S               Add them across columns.

   µ              Monadic chain. Argument: S (list of column sums)
    ḟ0            Remove all occurrences of 0.
      Ṣ           Sort the remaining sums.
       .ị         Take the elements with indices around 0.5.
                  Indices are 1-bases, so this selects the last and the first one.
             U    Yield S, reversed.
            @     Reverse the arguments.
         e€       Test each item in the left list for membership in the right one.
              Ḅ   Convert from binary to integer.

Although there's disagreement on exactly how to judge it, this meta question suggests the community is strongly in favour of no longer marking answers as non-competing when the challenge predates the creation of the language. I'm therefore accepting this answer.

Pyth, 26 25 bytes
JsM.T_MjR2Qi_}RhM_BS-J0J2

Try it online: Demonstration or Test Suite
Explanation
JsM.T_MjR2Q
       jR2Q      convert each input number to binary (lists of 1s and 0s)
     _M          reverse each list
   .T            transpose (with top justify)
 sM              sum up each list (numbers of 1s at each position)
J                store this list in J

i_}RhM_BS-J0J2
         -J0     J without 0s
        S        sorted
      _B         create the list [sorted, reverse(sorted)]
    hM           take the first elments of each (bitsum-min and bitsum-max)
  }R        J    check for each value in J, if it is part of ^
 _               reverse this list of booleans
i            2   convert from binary to base 10 and print

The _B use is brilliant

J, 31 30 24 23 21 bytes
+/(e.>./,<./@#~@)&.#:

This is a tacit, monadic verb that takes a list of decimal integers and returns their decimal biplex.
Thanks to @Zgarb for his suggestions, which saved 4 bytes directly and paved the way for 2 more!
Thanks to @randomra for golfing off 2 more bytes!
Test cases
   biplex =: +/(e.>./,<./@#~@)&.#:

   biplex ,1
1
   biplex ,2
2
   biplex 1 2 5
7
   biplex ,4294967295
4294967295
   biplex 2454267026 2863311530 3681400539
3817748707
   biplex 2341103945 2969112506 1849078949 1430639189
3

How it works
                 &.    Dual. Apply the verb to the right, the verb to the left,
                       and finally the inverse of the verb to the right.
                   #:  Convert the input list from integer to base 2.
  (            @)      Define an adverb, i.e., an operator that takes a verb as
                       its left argument.
+/                     Call it with "reduce by sum". This calculates the sum of
                       the corresponding binary digits of all integers before
                       executing the remainder of the adverb's body, i.e, this:
             #~          Replicate the sum N a total of N times, i.e., turn
                         0 1 2 3 into 1 2 2 3 3 3. This eliminates zeroes.
         <./@            Calculate the minimum of the result.
     >./                 Calculate the maximum of the sums.
        ,                Append; wrap both extrema into a list.
   e.                    Check if each of the sums is in the list of extrema.
                         This yields 1 if yes and 0 if no.
                       (from &.) Convert from base 2 to integer.

Minkolang 0.10, 109 79 bytes
(n1$(d2%$r2:d)99*I-DmI2:[+1R]$I)rI$d$(s0(x0gd,)Ik3R2g1-X0I3-[2*2gd0c=$r1c=++]N.

Input and output are in decimal. Try it here.
Explanation
(                            $I)    Loop until input is empty
 n                                  Read in number from input
  1$(       d)                      Start a while loop with only the top of stack
     d2%                            Next least-significant bit (modulo by 2)
        $r                          Swap top two values
          2:                        Divide by 2
              99*I-D                Pad with 0s
                                    (when the while loop exits, top of stack is 0)
                    m               Merge (interleave) stack
                     I2:[   ]       For each pair...
                         +1R        Add and rotate stack to the right
                                    <<This does the work of computing bitsums>>

r       Reverse stack
 I      Push length of stack
  $d    Duplicate whole stack
        <<This lets me sort the bitsums without affecting the original order>>

$(                      Start while loop with <top of stack> elements
  s                     Sort
   0(     )             Push a 0 and start another while loop
     x                  Dump top of stack
      0g                Get front of stack and put it on top
        d,              Duplicate and <not> for end-while condition check
           Ik           Push length of stack and break out of while loop
             3R         Rotate [min, max, length] to front
               2g1-     Get length and put it on top, then subtract 1
                   X    Dump that many elements off the top of stack
                        <<Now I have min and max>>

0                        Initialize decimal with 0
 I3-[               ]    For as many bits as there are...
     2*                  Multiply by 2
       2gd               Get the next most significant bit and put it on top
          0c=            Copy min and check for equality
             $r          Swap top two elements of stack
               1c=       Copy max and check for equality
                  ++     Add 1 if bitsum item is equal to min or max, 0 otherwise
N.                       Output as integer and stop

Old version:
$nI[(d2%i1+0a+i1+0A00ai`4&i00A2:d)x]00a1+[i1+0a]s0(x0gd,)rI2-[x]00a1+[i1+0ad0c=$r1c=+]0gx0gx0(xd,)0I1-[2*+]N.

Try it here!
Explanation
The crux of it is that the array feature is heavily used (a A) to store the bitsums, of which the minimum and maximum are found, then 1s and 0s are outputted appropriately, with dumping of leading 0s in two places.
$n                                      Read in whole input as integers
  I[(                             x]    Convert each number to binary
     d2%                                Get next least significant bit (modulo by 2)
        i1+0a                           Get current value in array for that position
             +                          Add
              i1+0A                     Put current value in array for that position
                   00ai`                Get first value of array (bitsum length)
                      i`                Greater than loop counter?
                        4&i00A          If not, put loop counter there
                              2:        Divide by 2
                                d)      If 0, exit loop

00a                Get first value of array (maximum length
   1+              Add one
     [i1+0a]       Get bitsum values from array and push on stack
            s      Sort
0(                 Push a 0 (for dump) and start a while loop -- dumps leading 0s
  x                Dump top of stack
   0g              Get bottom of stack
     d,            Duplicate and <not> it
       )           Exit loop when top of stack is non-zero (i.e., the minimum)
        r          Reverse stack (so now it's [min, max, <stuff>])
         I2-[x]    Dump everything else

00a1+[               ]    Get bitsum length and loop that many times
      i1+0a               Get bitsum value at current position
           d              Duplicate
            0c=           Copy front of stack and check for equality
               $r         Swap
                 1c=      Copy next-to-front of stack and check for equality
                    +     Add (so it's 1 if it's equal to min or max, 0 otherwise)

0gx0gx       Dump front two elements of stack (the min and max)
0(xd,)       Dump leading 0s
0            Push 0 for conversion to decimal
 I1-[   ]    For each bit...
     2*+     Multiply by 2 and add
N.           Output as integer and stop

From the online interpreter, does this take decimal input and give binary output?

Yes. Do I need to change that?

I'm afraid so. From the question: "You may choose to use any base for input and output (including binary and unary), provided they are both in the same base"

Ahhh, I was looking for it in the bullet points and missed it in the very first sentence. I'll fix it sometime today.

I was tempted to include it in both - it doesn't quite fit where it is (several people have missed it and asked me about it).

Fixed! And with only two extra bytes! :D

I'd like a full explanation? Is not the goal of your language to have others at one point use it? And don't thorough explanations directly facilitate that?

I do provide thorough explanations for most of my Minkolang answers. This one is particularly long though, so I didn't want to put in the effort if no one requested. But because you have, I'll add one. :)

@ThomasKwa: I've added the explanation. Perhaps now you see why I was putting it off? :P

You've earned my +1; I'm glad to learn about Minkolang.

Brainfuck, 619 bytes
First answer in far too long here, so I thought I'd do a good one!
>->->->>>,----------[--<++++++[>------<-]>>>>,----------]-<<<+[-<<<+]->>,<++++[>--------<-]>[<++++[>+++++<-]>++[--<++++++[>------<-]>>>+>]<-[+>-<<+[-<<<+]-<<+[->+[->[-[->>>+<<<]<<<+]+[-->>>++]-<+]<<<+[-[->+<]<<<+]->>+>]<-[+>->>>>+[->>>+]->+[-<[-[->>>+<<<]<<<+]+[-->>>++]->+]-<+<<<+[-[->+<]<<<+]->>]]>,<++++[>--------<-]>]>+[->>>+]>->->>-[+<<<<<<+[-<-<<+]->>[+>>>[>>>]>+[<<->>[->>>+]->>>[-]+<<<<<+[-<<<+]+>->]<]>->>+>-]<[<<<<<+[-<+<<+]->>[-]>+[->>>+]->>-]>-[+<<<<<<+[-<+<<+]->>[->>>[>>>]>+[<<<->>>[->>>+]->>>[-]+<<<<<<+[-<<<+]+>>+>]<]>->>>-]<<<<-<<<<+[->[-]<[->+<]<[->>[-]+<<]<<+]>-[+>>>-]++[->++++++[-<++++++++>]<.>>>+]

Did... Did I win?
This program expects newlines (ASCII 10) after every binary number, and requires a space (ASCII 32) at the end.
Test runs:
Me$ bf bpx.bf
1
10
101

111

Me$ bf bpx.bf
11111111111111111111111111111111

11111111111111111111111111111111

Me$ bf bpx.bf
10010010010010010010010010010010
10101010101010101010101010101010
11011011011011011011011011011011

11100011100011100011100011100011

Me$ bf bpx.bf
10001011100010100110100101001001
10110000111110010000111110111010
1101110001101101011010010100101
1010101010001011101001001010101

11

(Newlines added after each case with ++++++++++. added at the end of the program)
Explanation
Still a work in progress, but a slow one. For lack of time, I've just copied the notes I made whilst writing this program, which will suffice for an explanation for now:
[Biplex Calculator]

[

Bitsum writing philosophy:

Start with [0 255 255 255 ...].
The 255s will be markers that we can 'search' for to get back to the start.
After that, the next byte should be a 0, fairly permanently. (The first reference 0)
It is useful to have 0-bytes handy for general calculations.
The next byte is where we will read the first digit of any binary number. (The first read)
The next byte holds the first bitsum.
Afterward, the next byte is 0, the following byte is the place
to read the second binary digit, the following byte is the second bitsum,
and so on.
I'll use the terminology nth reference 0, nth read, and nth bitsum to refer to
each part of the triplet of bytes.

The location three places after the final bitsum will be 255,
and the location three places after the final read will be 255.
We can move entire numbers by lining up these 255s after every binary number.

]

>->->->>>~                  [0 255 255 255 0 0 0 0 0                ]

[From the first bitsum, read input to create an initial set of bitsums                  ]
,----------
[
    --<++++++[>------<-]            [Convert the input '1' or '0' into a bit        ]
    >>>>,----------
]~
-<<<+[-<<<+]->>                 [Mark 255 after the last bit, then go back to first read]

,<++++[>--------<-]             [Check for space, using the first reference 0       ]
>
[
    <++++[>+++++<-]             [Check for \n                       ]
    >++
    [
        --<++++++[>------<-]        [It wasn't \n, so convert the input into a bit      ]
        >>>+>               [Write 1 to the next reference 0, and go to next read   ]
    ]
    <-
    [
        +>              [It was \n                      ]
        -<              [Mark 255 on this (nth) read and go to (n-1)th bitsum   ]
        <+[-<<<+]           [Search for a 255 off to the left           ]

        [We've either struck our marker, or the last bitsum. We need to check.          ]
        -<<+
        [
            -           [We hit the last bitsum. Move the bitsums right.    ]
            >+
            [
                ->[-[->>>+<<<]<<<+] [Move until we reach the start          ]
                +[-->>>++]      [From the start, move to our last bitsum    ]
                [Repeat this move until the read here is a 255              ]
                -<+
            ]
            [We now need to go to the first reference zero, and put a 1 there       ]
            <<<+[-[->+<]<<<+]->>+>      [Add bits to bitsums and end on first read  ]
        ]
        <-
        [
            +>->>>>+[->>>+]     [Go to the 255 after our reads              ]
            ->+
            [
                -<[-[->>>+<<<]<<<+] [Move until we reach the start          ]
                +[-->>>++]      [From the start, move to the 255 after our reads]
                [Repeat this move until we see the 255 bitsum               ]
                ->+
            ]
            [We now need to go to the first read                        ]
            -<+<<<+[-[->+<]<<<+]->>     [Add bits to bitsums and end on first read  ]
        ]
        >>>>>>>>>>>>>>>>>>>>>>>>>~<<<<<<<<<<<<<<<<<<<<<<<<<
    ]

    [We're at the reference 0 to the left of our next read                      ]
    >,<++++[>--------<-]            [Check for space, using the first reference 0       ]
    >
]

[

Let BN be the nth bitsum. Then our situation at the moment is:

[0 255 255 255 0 0 B1 0 0 B2 ... 0 0 BN 0 0 255]
                 ^
I'm just happy nothing's exploded yet.

]

[Next goal: Mark the minimums                                       ]

>+[->>>+]>->->>~            [Zero the 255 and put 2 255s after it, then move after it   ]

-[
    +<<<<<<
    +[-<-<<+]               [Subtract one from each bitsum              ]
    ->>
    [
        +>>>[>>>]           [Find the first 0 bitsum                ]
        >+
        [
            <<->>[->>>+]->>>[-]     [Mark the zero as a minimum, and set a flag     ]
            +<<<<<+[-<<<+]+>->
        ]
        <
    ]
    >->>+>-
]~

[Hey, that worked. Weird. Alright, moving on...                             ]
[Reset the bitsums to what they were before we messed them all up                   ]

<[<<<<<+[-<+<<+]->>[-]>+[->>>+]->>-]>~

[After the stuff up there, that's not too bad.                              ]
[Now it's time to mark the maximums, in virtually the opposite way we did the minimums.         ]

-[
    +<<<<<<
    +[-<+<<+]               [Add one to each bitsum                 ]
    ->>
    [
        ->>>[>>>]           [Find the first 0 bitsum                ]
        >+
        [
            <<<->>>[->>>+]->>>[-]   [Mark the zero as a maximum, and set a flag     ]
            +<<<<<<+[-<<<+]+>>+>
        ]
        <
    ]
    >->>>-
]~

[Alright, now OR the maxs and mins, take care of leading zeros, output, and cross fingers       ]
<<<<->>~<<<<<<~+[->[-]<[->+<]<[->>[-]+<<]<<+]>-[+>>>-]++[->++++++[-<++++++++>]<.>>>+]

Newline separated and space terminated is perfectly valid. +1

CJam, 27 bytes
q~2fbWf%:.+_0-$(\W>|fe=W%2b

Takes input as a base-10 CJam-style list. Test it here. Alternatively, run all test cases (the script discards the expected output and converts the input format as necessary).
Explanation
q~    e# Read and evaluate input.
2fb   e# Convert each number to base 2.
Wf%   e# Reverse each digit list, to align digits in case there are numbers with different
      e# widths.
:.+   e# Add up the bit planes.
_0-   e# Make a copy and remove zeroes.
$     e# Sort the bit plane sums.
(\W>| e# Get the first and last element. We use set union instead of addition so that the
      e# resulting array will contain only one value if min = max.
fe=   e# For each element in the bit plane sums, count how often it appears in the min/max
      e# array, which is either 1 or 0.
W%    e# Reverse the digits again (to undo the initial reversing).
2b    e# Interpret as base-2 digits.

Shouldn't the output be the bitsum maximum and minimum?

@DavidCarraher No, see the examples. The output should be a number whose binary representation has 1s in those bits which correspond to the bit planes where the minima and maxima occurred.

JavaScript (ES6), 215 185 176 bytes
f=a=>{s=[];for(i of a)for(b=i.toString(2),d=l=b.length;d--;)s[x=l-d-1]=(s[x]|0)+(b[d]|0);q=255;for(r of s)d=r>d?r:d,q=r<q?r||q:q;o="";s.map(r=>o=(r==q|r==d)+o);return+("0b"+o)}

Usage
f([2454267026, 2863311530, 3681400539])
=> 3817748707

Explanation
f=a=>{

  // Create an array of bitsums
  s=[];                   // s = bitsums
  for(i of a)             // iterate through the passed array of numbers
    for(
      b=i.toString(2),    // b = number as binary string
      d=l=b.length;       // l = number of digits in b
      d--;                // iterate through each digit of the binary string
    )
      s[x=l-d-1]=         // add to the digit of the bitsum array
        (s[x]|0)+         // get the current value of the bitsum array (or 0 if null)
        (b[d]|0);         // add the result to the bitsum array

  // Get the maximum and minimum bitsums
  q=255;                  // q = min bitsum
  //d=0;                  // d = max bitsum
  for(r of s)             // iterate through the bitsums
    d=r>d?r:d,            // set d to maximum
    q=r<q?r||q:q;         // set q to minimum

  // Calculate the result
  // (unfortunately JavaScript only supports bitwise operations on signed 32-bit
  // integers so the temporary binary string is necessary)
  o="";                   // o = output
  s.map(r=>               // iterate through the bitsum digits
    o=(r==q|r==d)+o       // add a 1 to the string if the digit is equal to min or max
  );
  return+("0b"+o)         // convert the binary string to a number
}

Welcome to PPCG! I see a couple of ways that this could be made shorter. 1) When defining an arrow function with one parameter, you don't need the parentheses around it. f=(a)=>{} = f=a=>{} 2) You could turn your for...in loops into for...of loops, saving a few bytes: for(i in a)for(b=a[i]... = for(i of a)for(b=i..., for(i in s)r=s[i],d=... = for(r of s)d=... 3) Bitwise OR | automatically changes true to 1 and false to 0, so o+=r==q|r==d?1:0; is the same as o+=r==q|r==d;.

At the end you can make: return parseInt(o,2) to: return+('0b'+o)

To save 2 bytes, you can replace s[l-d-1]=(s[l-d-1]|0) with s[T=l-d-1]=(s[T]|0). To shave more 2, replace b=i.toString(2),l=b.length,d=l with d=l=(b=i.toString(2)).length.

Julia, 141 bytes
A->(s=reduce(.+,map(i->digits(i,2,maximum(map(i->ndigits(i,2),A))),A));parse(Int,reverse(join([1(i∈extrema(filter(j->j>0,s)))for i=s])),2))

Ungolfed:
function biplex(A::AbstractArray)
    # Get the maximum number of binary digits in each element
    # of the input array
    L = maximum(map(i -> ndigits(i, 2), A))

    # Create an array of arrays of binary digits corresponding
    # to the inputs
    B = map(i -> digits(i, 2, L), A)

    # Get the bitsums
    S = reduce(.+, B)

    # Replace the minimum and maximum bitsums with ones and
    # the rest with zeros
    s = [1 * (i in extrema(filter(j -> j > 0, S))) for i in S]

    # Join this into a string and parse it as a base 2 integer
    # Reverse is required because digits() returns the digits
    # in reverse order
    p = parse(Int, reverse(join(s)), 2)

    return p
end

Simplex v.0.7, 38 bytes
Simplified comments. Input in Binary, no interpreter working at the moment. Hopefully the comments are sufficient.
hj&=j&Lun?&RvRpp]{Ri}^XKRJ@jqLhR@LhuTo
h               ]                        ~~ define macro 0
 j&                                      ~~ insert a new byte and write register to it
   =                                     ~~ equal to the previous byte?
    j&                                   ~~ insert a new byte and write register to it
      L                                  ~~ return to equality
       u    v                            ~~ go up/down a strip
        n?&                              ~~ write the register iff byte = 0
           R                             ~~ go right
             Rpp                         ~~ remove two bytes
                 {Ri}                    ~~ take input until input = 0
                     ^X                  ~~ take the sum of the strip
                       K                 ~~ split that sum into digits
                        RJ@              ~~ take the max; write to register
                           jq            ~~ take the min
                             Lh          ~~ call macro 0
                               R@        ~~ set min to register
                                 Lh      ~~ apply macro 0
                                   uTo   ~~ output result

Octave, 50 bytes
@(a)["" ((b=sum(a-48))==max(b)|b==min(b(b>0)))+48]

Example:
octave:1> g = @(a)["" ((b=sum(a-48))==max(b)|b==min(b(b>0)))+48] ;
octave:2> g(["10010010010010010010010010010010"; "10101010101010101010101010101010"; "11011011011011011011011011011011"])
ans = 11100011100011100011100011100011

I'd love to see an explanation for this one...

@trichoplax I'm not too brilliant with matlab/octave, but hopefully this helps: @(a) defines an anonymous function that takes an input vector a. [""  forces the output into a string (I believe). (b=sum(a-48)) defines b to be the vector containing the bitsums. b==max(b) will be a vector having a 1 in a given place if the bitsum there is a maximum, and a 0 otherwise. b(b>0) is a vector of every element of b greater than 0, so b==min(b(b>0)) is a vector containing a 1 when the bitsum is the minimum, and 0 otherwise. Then it's OR'd together, and +48 for ASCII.

@BrainSteel all makes sense now - thank you

Sometimes I forget how different Octave and MATLAB are. I guess I should really start using Octave for golfing in the future, my shortest MATLAB attempt is 60 bytes because you cannot use inline assignment and end up with function o=b(i) (newline) r=sum(i>48);o=['' (r==max(r)|r==min(r))+48];

Haskell, 198 182 178 161 character
I'm still beginner at golfing. Only 80 reputation comes from answer.
m=map
v=reverse
(b:x)&(c:y)=(b+c):x&y
[]&a=a
b&_=b
l=(show=<<).v.(\a->m(fromEnum.(`elem`[maximum a,minimum$(replicate=<<id)=<<a]))a).foldl1(&).m(m(read.(:[])).v)

How does it work.
Instead of padding, I reverse the array then I add using user defined (&). I don't use foldl1(zipWith(+)) that is shorter because zipWith will delete the superflous item. Then I find the maximum and nonzero minimum, that also required user defined function. Then I match the item with the maximum and nonzero minimum, 1 if match, 0 if it doesn't match. Then we reverse and turn it into binary number.
TODO:

Using Data.List

I've edited the input requirements to allow string input, provided the digits are not separated.

@trichoplax Thanks. Is there anything to golf?

I'm not a Haskell expert but you might find one in [chat]... Everyone's welcome :)

@trichoplax My browser can't access it.

In the definition of k, c is only used once, so no need to put it in the where clause. Use it directly: ...||(x==a#b).... Why the curly braces? In l: concat.map show is concatMap show or even better >>=: l=(>>=show).v.... (Note: there's also =<< which does the same, but with arguments flipped: (show=<<).v...).  >>= and =<< work in list context here and do different things in function or other contexts.

You can replace [] in the last cases of & and # with _: b&_=b and _#l=l.

@nimi Thanks. concat.m is shorter that concatMap. However, your idea about (show=<<) is brilliant. I don't remove it as an trauma. I was removing both b and c and find it that it changes answer.

(x==b)||(x==c) (or (x==b)||(x==a#b) when you remove c) can be replaced by elem x[b,c] (resp: elem x[b,a#b]).

Removing c changes the result? Do you have an example input?

The problem is b

u=maximum and k a=m(\x->fromEnum$elem x[u a,a#u a])a should work.

Don't do _&a=a, it must stay []&a=a, else the first list is lost if the second is empty. Use _ only in the last case - maybe that is your error.

JavaScript (ES6), 158
A function with a numeric array parameter, returning a number. With the same byte count it could get a string array parameter (containing base 2 rapresentations) and return a base 2 string - just move the .toString(2) at the end after r.

f=l=>(l.map(v=>[...v.toString(2)].reverse().map((x,i)=>t[i]=~~t[i]-x),t=[]),t.map(v=>(r+=v==Math.min(...t)|v==Math.max(...t.filter(x=>x))&&b,b+=b),r=0,b=1),r)

// More readable

u=l=>(
  t=[],
  l.map(v =>
    [...v.toString(2)]
    .reverse()
    .map((x,i) => t[i] = ~~t[i] - x)
  ),
  r=0,b=1,
  t.map(v => (
    r += v==Math.min(...t) | v==Math.max(...t.filter(x=>x)) && b, b+=b
  )),
  r
)

// Test
console.log=s=>O.innerHTML+=s+'\n'

;[
 [[1], 1]
,[[2], 2]
,[[1, 2, 5], 7]
,[[4294967295], 4294967295]
,[[2454267026, 2863311530, 3681400539], 3817748707]
,[[2341103945, 2969112506, 1849078949, 1430639189], 3]
].forEach(t =>{
  r=f(t[0])
  x=t[1]
  console.log('Test '+(r==x?'OK':'Fail (Expected: ' + x +')')
  +'\nInput: '+t[0]+'\nResult: ' +r+'\n')
})

Python 3, 181 126 122 bytes
(I took out most of the byte count slashes because it was getting a bit ridiculous.) 21 bytes off thanks to Sp3000!
*z,=map(sum,zip(*[map(int,t.zfill(99))for t in input().split()]))
k=0
for x in z:k=k*10+(x in[min(z)or 1,max(z)])
print(k)

Slightly less golfed:
s=input().split()
k=list(map(lambda t:list(map(int,t))[::-1],s))
z=list(map(sum,zip(*k)))
y=z[:]
while min(y)==0:y.remove(0)
a,b=min(y),max(y)
f=''.join(map(lambda x:str(1*(x in[a,b])),z[::-1]))
print(int(f))

Input is expected in binary with only spaces separating the numbers. Output is in binary as well.

Javascript, 154 150 bytes
t=i=>(m=0,r=[],i.map(n=>{for(j=31;j+1;r[k=31-j]=(r[k]|0)+((n>>>j)%2),--j);}),r.map(n=>m=(n==Math.min(...r.filter(x=>x))|n==Math.max(...r)?1:0)+m*2),m)

Thanks for edc65 method for min/max calculation, it shortened my code by 4 bytes.
Explanation
t=i=>(
    m=0,//m=>output
    r=[],//Bitsum then final number in binary
    i.map(
        n=>
        {
            //Decimal to binary + bitsum
            for(j=31;j+1;r[k=31-j]=(r[k]|0)+((n>>>j)%2),--j);
        }),
    //Output formatting
    r.map(
        n=>
            m=(n==Math.min(...r.filter(x=>x))|n==Math.max(...r)?1:0)+m*2
        ),
    m
)

+1 nice. Bit arithmetic beats string conversion by far. And I see 2 ways to shorten it more.

132: f=i=>(m=0,r=[],i.map(n=>{for(k=32;k--;n=n/2|0)r[k]=~~r[k]+n%2}),r.map(n=>m+=m+(n==Math.min(...r.filter(x=>x))|n==Math.max(...r))),m)

Even better! I need to learn more about golfing for loops, still not use to hijeck for instructions.

ShapeScript, 186 bytes
'"1
"$0?_1-"+"*":2"@~@"0
"~"0
"$"
"~+'1?_*!"2"$"0"~"
"$""~":"1?'@1?"+"$_1>"+"*+@1?"0"+$""~'1?_*!#"0"+@":+"'1?1?"0"+$_2<"+"*+'1?_*!"0"+$"1"~@$"1"~":"$""~"+"$""~'"
"@+"
0"$""~'1?_*!"
"$""~

An important, useless language for an important, useless operator.
I/O is in binary. The program expects each number on a separate line, each ending with a linefeed.
Try it online!
Test cases
$ echo -e '1' | shapescript biplex.shape; echo
1
$ echo -e '10' | shapescript biplex.shape; echo
10
$ echo -e '1\n10\n101' | shapescript biplex.shape; echo
111
$ echo -e '11111111111111111111111111111111' | shapescript biplex.shape; echo11111111111111111111111111111111
$ echo -e '10010010010010010010010010010010\n10101010101010101010101010101010\n11011011011011011011011011011011' | shapescript biplex.shape; echo
11100011100011100011100011100011
$ echo -e '10001011100010100110100101001001\n10110000111110010000111110111010\n1101110001101101011010010100101\n1010101010001011101001001010101' | shapescript biplex.shape; echo
11

I don't know what this garbage is you call a language, but I love it!

APL, 27 bytes
{2⊥S∊(⌈/,⌊/)0~⍨S←+/⍵⊤⍨32⍴2}

This is a monadic function that takes a list of decimal integers and returns their decimal biplex.
Try it online in the ngn/apl demo.
How it works
                     32⍴2  Create a list of 32 2's.
                  ⍵⊤⍨      Base-encode the right argument.
                +/         Add the corresponding binary digits.
              S←           Save the sums in S.
           0~⍨             Remove 0's.
    (⌈/,⌊/)                Apply minimum (⌊/), maximum (⌈/) and concatenate.
  S∊                       Check which binary digits are in the extrema list.
2⊥                         Convert from base 2 to integer.

Wolfram Language, 113 bytes
This version takes input from a popup window, with the numbers being input in the form "{x,y,z,...}", (no quotes).
FromDigits[#/.{Max[#]->1,Min[#/.{0->Nothing}]->1,_Integer->0},2]&@Total[PadLeft[IntegerDigits[#,2],33]&/@Input[]]

Input:

Output:

Takes input in a dynamic Manipulate as a string of the form "{x,y,z}" with x, y, and z being base 10 integers (with or without leading zeroes). The output is also in base 10.
Manipulate[FromDigits[#/.{Max[#]->1,Min[#/.{0->Nothing}]->1,_Integer->0},2]&@Total[PadLeft[IntegerDigits[#,2],33]&/@ToExpression@i],{i,"{1}"}]

There are other ways to input this in a way that would save on character counts, but I think this solution is an elegant use of a dynamic GUI that performs the computation
If you want to run this in the cloud, we can use CloudDeploy:
o=CloudDeploy[FormPage[{"i"->"String"},(FromDigits[#/.{Max[#]->1,Min[#/.{0->Nothing}]->1,_Integer->0},2]&@Total[PadLeft[IntegerDigits[#,2],33]&/@ToExpression@#i])&]];SetOptions[o,Permissions->{All->{"Read","Execute"},"Owner"->{"Read","Write","Execute"}}];o

The Cloud deploy brings the character count up to 256 however...
The input to the FormPage is also a string of the form "{x,y,z}" with x, y, and z being base 10 integers.
I cloud-deployed this myself and you can try it out at https://www.wolframcloud.com/objects/97b512df-64f8-4cae-979b-dba6d9622781

I've tested the cloud link without the leading zeroes and it still correctly outputs 3.

If you have shorter code without the GUI, you can edit it into this answer to improve your score, and still leave the GUI version in your answer as an alternative example to show what's possible. Best of both worlds...

@trichoplax Noted, I added what I think is the shortest version with Input[]. Could also hypothetically expect the numbers to be stored in a variable, which could also decrease the character count, but then it's ambiguous as to how you enter the input into it I think

Storing the numbers in a variable isn't one of the default input methods... So that additional step isn't available, but what you have so far is great :)

Python 3, 197
import itertools
o='0'
d=[sum(map(int,n))for n in itertools.zip_longest(*map(reversed,input().split(' ')),fillvalue=o)]
m=max(d),min(d)or 1
print(''.join((o,'1')[g in m]for g in d[::-1]).lstrip(o))

It takes in space delimited binary numbers.
Ungolfed version:
import itertools
nums = map(reversed, input().split(' '))
digits = []
for num in itertools.zip_longest(*nums, fillvalue='0'):
    current_digit = sum(map(int,num))
    digits.append(current_digit)
bit_max = max(digits)
bit_min = min(digits) or min(digits) + 1
print(''.join(('0','1')[digit in(bit_max,bit_min)]for digit in digits[::-1]).lstrip('0'))

C#, 255
A complete program, input as command line arguments - space separated - in decimal.
using System.Linq;class P{static void Main(string[]l){var n=new uint[32];uint i,r=0,b;foreach(var v in l)for(i=0,b=uint.Parse(v);b!=0;b/=2)n[i++]+=b&1;b=1;foreach(var v in n){r+=(v==n.Max()|v== n.Min(x=>x>0?x:n.Max()))?b:0;b+=b;}System.Console.Write(r);}}

More readable:
using System.Linq;

class P
{
    static void Main(string[] l)
    {
        var n = new uint[32];
        uint i, r = 0, b;

        foreach (var v in l)
            for (i = 0, b = uint.Parse(v); b != 0; b /= 2) n[i++] += b & 1;
        b = 1;
        foreach (var v in n)
        {
            r += (v == n.Max() | v == n.Min(x => x > 0 ? x : n.Max())) ? b : 0;
            b += b;
        }
        System.Console.Write(r);
    }
}

Suggest v==n.Max()|v==n.Min(x=>x>0?x:n.Max()) instead of (v==n.Max()|v== n.Min(x=>x>0?x:n.Max()))

C++, 192 bytes
Accepts input a 32 bit unsigned integer array, and a count of items in that array.
typedef unsigned long U;U b(U*a,int c){U x[32],t,i,j,M=0,m=c,r=0;for(i=0;i<32;x[i++]=t,m=t&&m>t?t:m,M=M<t?t:M)for(t=j=0;j<c;)t+=a[j++]>>i&1;for(i=0;i<32;++i)r|=(x[i]==m||x[i]==M)<<i;return r;}

Ungolfed :
unsigned long b(unsigned long*a, int c){
    unsigned long x[32],t,i,j,M=0,m=c,r=0;
    for(i=0;i<32;x[i++]=t){
        m = (t && m > t)?t:m;
        M = M < t ? t:M;
        for(t=j=0;j<c;){
            t+=a[j++]>>i&1;
        }
    }
    for(i=0;i<32;++i)
        r|=(x[i]==m||x[i]==M)<M;m=d if m>d&&d
alert +(+(d in[m,M])for d in b).join ''

Try it.

Ruby, 127 bytes
def f l;a=[];32.times{|i|a[i]=0;l.each{|n|;a[i]+=n[i]}};a.map{|b|a.reject{|c|c==0}.minmax.index(b)?1:0}.reverse.join.to_i 2;end

Takes an array as input.

GolfScript, 46 bytes
~{2base-1%}%zip{{+}*}%-1%.$0-)\1<|`{&,}+%2base

Try it online on Web GolfScript.
Test cases
$ golfscript biplex.gs <<< '[1]'
1
$ golfscript biplex.gs <<< '[2]'
2
$ golfscript biplex.gs <<< '[1 2 5]'
7
$ golfscript biplex.gs <<< '[4294967295]'
4294967295
$ golfscript biplex.gs <<< '[2454267026 2863311530 3681400539]'
3817748707
$ golfscript biplex.gs <<< '[2341103945 2969112506 1849078949 1430639189]'
3


text:
Multiplying substrings
Write a program that takes two integers as an input; the first can be any integer and the second is less than or equal to the number of digits in the first number. Let these numbers be a and b respectively.
The program will do the following

Concatenate a minimal number of 1s to the end of a so the number of digits in a is divisible by b.
Split a along every b digits.
Multiply the digits in each section together.
Concatenate the products together (if one of the numbers is zero, then concatenate 0).
Repeat this process until a number with strictly fewer than b digits is formed. Print this as the output, as well as the number of the process is repeated. Units are not necessary, but some form of separation between the final number and number of iterations is.

In the following test cases, the individual steps are shown for the purpose of understanding. It is not necessary for your program to display the steps.
Test case 1
1883915502469, 3
Steps
1883915502469          //Iteration 1
188391550246911
188 391 550 246 911
64 27 0 48 9
64270489               //Iteration 2
642704891
642 704 891
48 0 72
48072                  //Iteration 3
480721
480 721
0 14
014                    //Iteration 4
0

Sample Output: 0, 4
Test case 2
792624998126442, 4
Steps
792624998126442        //Iteration 1
7926249981264421
7926 2499 8126 4421
756 648 96 32
7566489632             //Iteration 2
756648963211
7566 4896 3211
1260 1728 6
126017286              //Iteration 3
126017286111
1260 1728 6111
0 112 6
01126                  //Iteration 4
01126111
0112 6111
0 6
06

Sample Output: 06, 4

The program must return an error (or just not print anything) if b>len(a). Also, b cannot equal 1 or the program will result in an infinite loop.

This is code golf, so standard rules apply. Shortest code in bytes wins.

Does it need to be a complete program, or is a function enough?

@Ypnypn A complete program.

So leading zeros count towards the length of a and are also included in the output?

@mbomb007 Yes, but only in the initial number. The chain of zeroes would be shortened to single zeroes in the concatenation of products.

@ypnypn you should say that explicitly in the question. The "standard rules"from the tag wiki say "the following defaults ... Answers may be either full programs or functions (or equivalent)."

Python, 156 bytes
g=lambda a,d,c=0,k=-1,j=''.join:d>(l:=len(a))and(a,c/c*c)or g(j([str(-[k:=k*x for x in map(int,j((a+l%d*"1")[i:i+d]))][k:=-1])for i in range(0,l,d)]),d,-~c)

Attempt This Online!
Takes in a string and an integer, causes a DivideByZero error if the input is invalid.

Python 3 + functools + operator, 137 bytes
g=lambda a,d,c=0,j=''.join:d>(l:=len(a))and(a,c/c*c)or g(j([str(reduce(mul,map(int,j((a+l%d*"1")[i:i+d]))))for i in range(0,l,d)]),d,-~c)

Attempt This Online!

Perl 6, 116 bytes
my ($a,$b)=@*ARGS;for 0..* {if $b>$a.chars {$_&&say "$a,$_";last};$a=map({[*] @_},($a~1 x$b-1).comb.rotor($b)).join}

my ($a,$b)=@*ARGS;
for 0..* {
  if $b>$a.chars {$_&&say "$a,$_";last}; # you need a ｢;｣ if you remove the newline
  $a=map(
    {[*] @_},
    ($a~1 x$b-1).comb.rotor($b)
  ).join
}

Python 3 + functools + operator, 242 241 205 bytes
Shorter version (thanks 97.100.97.109!)
def g(a,b):
 c,d,j=0,int(b),''.join
 while len(a)>=d:a=j(map(str,[reduce(mul,map(int,[*j(u)]))for u in zip(*[iter([a+"1"*n for n in range(d)if not len(a+"1"*n)%d][0//(d<=len(a))])]*d)]));c+=1
 return (a,c)

Original explained version:
def g(a,b):
 c=0
 while len(a)>=int(b):a="".join(map(str,[reduce(mul,map(int,u))for u in map(list,map(''.join,zip(*[iter([a+"1"*n for n in range(int(b))if not len(a+"1"*n)%int(b)][0])]*int(b))))]));c+=1
 return None if int(b)>len(a)else(a,c)

This was a fun one! I wish I could've made it a one-liner but there was no real way to do that without massively increasing the length. Takes input as two strings, returns a 2-tuple of a string and an int (or None if b>len(a))
Explanation
def challenge(a,b):
  c=0
  while len(a) >= int(b):
    a="".join(
      map(str,[
        reduce(mul,map(int,u)) # Multiply the digits together. Uses reduce from functools and mul from operator, works similarly to sum() but for multiplication
        for u in map(list,map(''.join,
                              zip(*[iter(
                                [a+"1"*n for n in range(int(b)) if not len(a+"1"*n)%int(b)][0] # Do the 1 concatenation
                              )]*int(b))
                             ) # Split a along every b digits
                    ) # Split those strings into lists
      ]) # Convert to a list of strings
    ) # Concatenate the products together
    c+=1
  return None if int(b)>len(a) else(a,c) # I don't really like the "return None if invalid input" requirement, but ah well

Am I using your code incorrectly?

You can reduce it by a lot

@97.100.97.109 Thanks!

CJam, 42 bytes
q~:N;Ab{_N(>}{_N/)N1e]a+::*s:~}w])S@,_])g*

Test it here.

Pyth, 32 bytes
IglzQf<l=zjk*MsMMc+z*\1%_lzQQQ)z

Demonstration
Takes input on two lines, a followed by b. Gives output on two lines, operations followed by result.
Pad: +z*\1%_lzQ
Chop: c ... Q
Convert to list of ints: sMM
Take products: *M
Convert back to str: jk
Assign back: =z
Check for termination: <l ... Q
Print iterations taken: f ... )
Print result: z
Initial check of whether to print anything at all: IglzQ

Ruby, 139 bytes
f=->n,b,i=1{c=[*n.scan(/.{#{b=b.to_i}}/),*$'[0]&&$'.ljust(b,?1)].map{_1.chars.map(&:to_i).reduce:*}*""
c.size<b ?[c,i]:f[c,b,i+1]}
p f[*$*]

Attempt This Online!
Explanation
f = ->n,b,i=1{                    # Recursive lambda definition; n is the number, b is the target length, i is the number of iterations
  c = [                             # Make an array of...
    *n.scan(/.{#{b=b.to_i}}/),        # the whole sections of length b
    *$'[0] && $'.ljust(b, ?1)         # plus, if there’s stray letters, the final section padded to length b
  ].map{
    _1.chars.map(&:to_i).reduce :*    # Multiply each section’s digits
  } * ""                            # Join back together

  c.size < b ?                      # If we’re under the target length...
    [c, i] :                          # return the remaining string and iteration count
    f[c, b, i+1]                      # otherwise call itself recursively, incrementing the iteration count
}

p f[*$*]                          # $* is ARGV; splat it into f's arguments