349
votes
Accepted
77
votes
66
votes
Upgoat or Downgoat?
Java, 93.9% 100%
This works by determining the row contrast in the upper and lower part of the image. I assume that the contrast in the bottom half of the image is bigger for 2 reasons:
the 4 legs ...
45
votes
Patch the Image
Matlab
This is a simple interpolation approach. The idea is first mirroring what is on each side of the patch. Then those mirror image pixels are interpolated by how close they are to the ...
42
votes
Upgoat or Downgoat?
Python 3, 91.6%
-edited with the new test cases
set filename to the goat picture you wish to test.
It uses a kernel to make an image top/bottom asymmetric.I tried the sobel operator, but this was ...
36
votes
Accepted
34
votes
Accepted
Black and White Rainbows
Matlab, 255 245 231 bytes
This expects the image name first, then y and then x.
...
31
votes
Computer Generated Cracked Soil
Mathematica
A Voronoi diagram looks like this drawing, from Wikipedia, showing 19 cells, each containing a single seed point. A cell consists of the subregion of points which the respective ...
30
votes
Paint by Numbers (using programming, not numbers)
Spectral airbrushing (Python, PIL, scipy)
This uses a sophisticated mathematical algorithm to produce colourful nonsense. The algorithm is related to Google's PageRank algorithm, but for pixels ...
29
votes
Invert png image
ImageMagick display -fx, 3 7 18 24 bytes
1-u
The ImageMagick tool display with the ...
26
votes
Upgoat or Downgoat?
Python 3, OpenCV with Hough Transform, 100%
My original idea was to detect the vertical lines of the goat's legs and determine its vertical position relative to the body and horizon.
As it turns out, ...
26
votes
Computer Generated Cracked Soil
Java
I used an approach based on recursive Voronoi diagrams. The outputs doesn't look very realistic, but I guess they're okay.
Here are some example images (resized to 250x250 so that it doesn't ...
25
votes
Paint by Numbers (using programming, not numbers)
Python 2 + PIL too, my first coloring book
...
25
votes
Patch the Image
Mathematica
This uses Mathematica's Inpaint function. Because Mathematica itself does all the heavy lifting, this is a community wiki.
...
Community wiki
24
votes
Paint by Numbers (using programming, not numbers)
Python 2 and PIL: Psychedelic Worlds
I have used a simple algorithm to flood fill each white-ish area with a color from a cycling palette. The result is very colorful, but not very lifelike.
Note ...
21
votes
Accepted
Sort the pixels
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 ...
21
votes
20
votes
Patch the Image
Python 2 and PIL
This program blends copies of regions North, South, East, and West to create replacement pixels that use colours, textures, and shading from the local image region.
The example ...
20
votes
XOR two monochrome images
The Fx Expression Language (ImageMagick), 8 4 bytes
EDITS
Simplified to u!=v, -4 bytes
As "Fx Expression Language" is apparently Turing complete, I've ...
19
votes
18
votes
Fill the holes in letters
Bash, 135 bytes
convert +antialias -pointsize 99 label:$1 -fill red -draw 'color 0,0 floodfill' -fill black -opaque white -fill white -opaque red i.png
Uses ...
18
votes
Invert png image
MATL, 10 bytes
255iYi-IYG
There are five different subformats of PNG, depending on how color is encoded. None of them seems to be more "optional" than the others....
18
votes
Accepted
Reconstruct a missing RGB channel
Python 3 + scikit-image
Simply sets the color of the missing channel to the average of the other two.
...
18
votes
Accepted
17
votes
15
votes
Upgoat or Downgoat?
Python 3, numpy, scikit, 100%
This code runs a goat-trained image classifier against a single filename, printing out 'Upgoat' or 'Downgoat'. The code itself is one line of python3, preceded by a ...
15
votes
XOR two monochrome images
Mathematica, 37 34 15 bytes
Thanks to Ian Miller for cutting the number of bytes by more than half!
ImageDifference
In the end, there's always a builtin. This ...
15
votes
14
votes
Patch the Image
Python 3, PIL
This program uses the sobel operator, and draws lines onto the image based on that.
The sobel operator finds the angle of each edge, so any edges extruding into the unknown area ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
image-processing × 133code-golf × 88
graphical-output × 55
popularity-contest × 26
code-challenge × 17
geometry × 7
compression × 6
test-battery × 6
ascii-art × 5
fractal × 5
color × 5
math × 3
matrix × 3
counting × 3
optical-char-recognition × 3
number × 2
array × 2
kolmogorov-complexity × 2
decision-problem × 2
random × 2
path-finding × 2
classification × 2
game-of-life × 2
hexadecimal × 2
steganography × 2