5 added 1 character in body
source | link

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a horizontally
         % symetric matrix. Center column pixels are uniformly distributed on the 
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155255
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a horizontally
         % symetric matrix. Center column pixels are uniformly distributed on the 
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a horizontally
         % symetric matrix. Center column pixels are uniformly distributed on the 
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/255
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file
4 added 5 characters in body
source | link

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a verticallyhorizontally
         % symetric matrix. Center rowcolumn pixels are uniformly distributed on the 
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a vertically
         % symetric matrix. Center row pixels are uniformly distributed on the
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a horizontally
         % symetric matrix. Center column pixels are uniformly distributed on the 
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file
3 deleted 16 characters in body
source | link

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation (to be updated)

H5H$r5l$r     % 2×55×5 arraymatrix of independent random numbersvalues with uniform distribution on (0,1)
l5H$r    % 1×5 array of independent random numbers with% uniformon distributionthe oninterval (0,1)
ytP+!     % Duplicate, flip %vertically, Duplicateadd, thetranspose. firstThis arraygives a vertically
P         % Flipsymetric vertically
vmatrix. Center row pixels are uniformly distributed on %the
 Concatenate the three arrays vertically    % interval (0,2). GivesRest have a 5×5triangular array
Ekdistribution on (0,2)
k     % Multiply by 2,% roundRound down:. givesIn 0either orof 1the equiprobably
!above cases, this gives 0 and 1
   % Transpose so that the array has% horizontalwith (notthe vertical)same symmetry.probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation (to be updated)

H5H$r    % 2×5 array of independent random numbers with uniform distribution on (0,1)
l5H$r    % 1×5 array of independent random numbers with uniform distribution on (0,1)
y        % Duplicate the first array
P        % Flip vertically
v        % Concatenate the three arrays vertically. Gives a 5×5 array
Ek       % Multiply by 2, round down: gives 0 or 1 equiprobably
!        % Transpose so that the array has horizontal (not vertical) symmetry.
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file

MATL, 36 29 bytes

5l$rtP+!kllII$r*O16tQ/XE'a'YG

This saves the result in file a.png.

Replacing 'a' by 2 in the code displays the image (scaled up) instead of saving a file:

5l$rtP+!kllII$r*O16tQ/XE2YG

Here's an example output:

enter image description here

Explanation

5l$r     % 5×5 matrix of independent random values with uniform distribution
         % on the interval (0,1)
tP+!     % Duplicate, flip vertically, add, transpose. This gives a vertically
         % symetric matrix. Center row pixels are uniformly distributed on the
         % interval (0,2). Rest have a triangular distribution on (0,2)
k        % Round down. In either of the above cases, this gives 0 and 1
         % with the same probability
llII$r   % 1×1×3 array of independent random numbers with uniform distribution
         % on (0,1). This is the foreground color.
*        % Multiply the two arrays with broadcast. Gives a 5×5×3 array. Ones in the
         % 5×5 array become the random foreground color. Zeros remain as zeros.
O        % Push 0
16tQ/    % 16, duplicate, add 1, divide: gives 16/17, or 240/155
XE       % Replace 0 by 16/17: background color
'a'      % Push file name
YG       % Write image to that file
2 added 10 characters in body
source | link
1
source | link