These challenges involve processing pre-existing image files, by altering them in some way, gathering statistics, or other image processing tasks.

learn more… | top users | synonyms

11
votes
9answers
2k views

Invert png image

Create program or function that takes file name as an argument or reads it from standard input, and completes the following task: Read image from a png file (name given as argument). Reverse colors ...
17
votes
2answers
885 views

Fun with flags!

Write a full program with a source code of 256 bytes or less that looks at an image of a flag and determines what country that flag is from. A zip file containing the 196 different flags in the ...
4
votes
0answers
222 views

Generate ASCII Art

Given a black-and-white image in any reasonable lossless format (png, ppm, etc.; filename or raw bytes) as input, output ASCII art that is as close to the input image as possible. Rules Only ...
9
votes
3answers
199 views

Find the different letter

You may have seen puzzles like this: Find the 0: OOOOOOOOOOOOOOOOOOOO0OOOOOOOOOOOOOOOOOO The challenge is to write a program that finds the index of the different letter given an image. Input ...
22
votes
11answers
1k views

Determining vertical slices

Given an image, output the [width in pixels of a full vertical section]1 (if one exists). If no vertical section exists, output 0. Input may be provided as a local file or a nested array. If you ...
8
votes
1answer
164 views

Extend the line

Task Given an image with a line on it, produce or display an image with the line extended the the line to the edge of image. The line is black and the background is white. The image size is 100x100 ...
12
votes
3answers
532 views

Fill the holes in letters

Sometimes when I'm bored, I take some text and fill the "holes" in the letters. But isn't filling the holes the most boring thing you can do? I think we should automate it, so we could use our time ...
187
votes
5answers
12k views

Upgoat or Downgoat?

Given an image of a goat, your program should best try to identify whether the goat is upside down, or not. Examples These are examples of what the input may be. Not actual inputs Input: Output: ...
73
votes
8answers
3k views

Patch the Image

In a popular image editing software there is a feature, that patches (The term used in image processing is inpainting as @mınxomaτ pointed out.) a selected area of an image, based on the information ...
26
votes
2answers
672 views

Compress an image to a 4 KiB preview

In this challenge you will be creating an image preview compression algorithm. It's goal is to reduce an arbitrary image file to a 4 KiB preview image, that can be used to quickly identify images with ...
23
votes
6answers
2k views

Flip It, Flop It, Mean It

Overview Given an image in plain PPM (P3) format as input, for each pixel p in the image, replace each of the following 4 pixels' red, green, and blue with the floored average value of the respective ...
48
votes
7answers
1k views

Paint by Numbers (using programming, not numbers)

Your task is to create a program which takes a black-and-white outlined image (example images are below) and fills it in with colour. It is up to you how you section off each region and which colour ...
4
votes
0answers
160 views

Build an image-glitching algorithm [closed]

It's well known that corrupted JPEG files or NTSC/PAL streams will appear as distorted versions of the true images, or versions covered in random-looking blocks of pixels. Consider the below image ...
8
votes
0answers
311 views

…And Mexico will Pay for It!

Donald Trump is very impressed with the work of the people on this site. He saw how amazing of a job you did helping Ben Carson, so he even hired you to build his wall. He thinks you're terrific. Now ...
16
votes
1answer
208 views

Count the number of sides on a polygon

Count the number of sides on a polygon The polygon-side-counting robot has decided to travel the world without telling anyone before, but it is crucial that the process of polygon counting is not ...
12
votes
5answers
975 views

What is that angle?

The goal of this challenge is to determine the angle of a line in a image. Rules on the image: The image background will be white (#FFFFFF) The stroke of the line will be black (#000000) The line ...
48
votes
3answers
2k views

Black and White Rainbows

Given an image that has only black and white pixels and an (x,y) location that's a white pixel, color the white pixels based on their minimal Manhattan distance from (x,y) in a path that only involves ...
14
votes
4answers
522 views

Make America(n Maps) Great Again

New Bonus! (See below) The cartography team of U.S. Republican presidential hopeful Ben Carson is having some trouble with their maps (image via Washington Post): The problem is they don't have ...
6
votes
1answer
317 views

Sobel edge detector

Your task is to write a program that takes an input image and run it through edge-detection to become an output image. The edge-detection works as follows (if unclear, see sobel edge detection): ...
33
votes
12answers
3k views

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 ...
23
votes
5answers
1k views

Seamless conversion from square to hexagon

For many games played on a grid, hexagons are the Clearly Superior Choice™. Unfortunately, many free game art sites only have seamless tile sets for square maps. On a past project, I used some of ...
19
votes
4answers
1k views

Force an Average on an Image

Write a program that takes in a standard truecolor image and a single 24-bit RGB color (three numbers from 0 to 255). Modify the input image (or output a new image with the same dimensions) such that ...
19
votes
10answers
3k views

Average Color of an Image

Average color of an image Scientists have been able to determine the average color of the universe but in how many bytes can we find the average color on an image? Your task Your input will be a ...
39
votes
4answers
3k views

This Is A Self-Referential Problem

Tupper's Self-Referential Formula (copied from Wikipedia) Tupper's self-referential formula is a formula defined by Jeff Tupper that, when graphed in two dimensions at a very specific location in the ...
17
votes
1answer
390 views

Chute-A-Pearing

Here are five images of pears and a steel chute: A: B: C: D: E: These are only thumbnails, click them for full size! (I made these with Algodoo.) This class of images always has the ...
18
votes
5answers
753 views

Remove the mininum sum seam from an array

The seam carving algorithm, or a more complex version of it, is used for content-aware image resizing in various graphics programs and libraries. Let's golf it! Your input will be a rectangular two ...
-2
votes
1answer
120 views

Generate a Pallette for an Image [duplicate]

This is a successor to my previous Code Golf challenge, which may be found here. This time, you are trying to determine what the contents of colors.txt should be. Your task is to take from the input ...
6
votes
5answers
902 views

Approximate a given image using only colors from a given list

The Specs Your program must read the image from one file and write the results to another file, the name of at least the first of which should be taken from the input You may accept and return any ...
140
votes
9answers
21k views

Draw an Image as a Voronoi Map

Credits to Calvin's Hobbies for nudging my challenge idea in the right direction. Consider a set of points in the plane, which we will call sites, and associate a colour with each site. Now you can ...
15
votes
3answers
733 views

You call it Centering, I call it Code Golf

"Let's face it, aligned images are like little gifts from Heaven. Welcome, but unexpected." - Geobits +10000 reputation to whoever wins this challenge. Rules: 1) You are to generate a program. 2) ...
13
votes
2answers
690 views

ASCII Art Generation

Task Write a program or function that takes an image of width w and height h, and two integers a <= w/2 and b <= h/2, and outputs an ascii art representation of the image, with the dimensions a ...
11
votes
1answer
479 views

Resize rasterized text and make it look non-pixellated

This is a screenshot of some text typed in a text editor: This is the same text at a larger size. Notice how visible the aliasing is on letters with prominent diagonal strokes like x and z. ...
6
votes
3answers
5k views

Getting a Highscore in Kuku Kube [closed]

First of all, this is more a challenge, than a serious programming question, I would like to share. Some of you might know the game Kuku kube, where you have to identify a square in a grid, which has ...
18
votes
3answers
626 views

Remove an unobstructed rectangle

This image was made by overlaying 7 differently colored rectangles on top of each other: The black and maroon rectangles are unobstructed, that is, no other rectangles are above them. Write a ...
8
votes
2answers
743 views

Write a GIF encoder

Yes, the good old GIF. Loved for its versatility, hated for its patents and partly obsoleted due to its limitations (and patents), GIF consists, at the core, of a color palette and a palette-indexed ...
15
votes
6answers
830 views

Tracing the Hues of an Image

Load an image into this stack snippet and move your mouse over it. A black curve that follows the hue angle, starting at your cursor point, will be drawn: <script ...
8
votes
6answers
1k views

Sort all the pixels of an image by the number of occurrences

Input The name of a file in the raster graphics format of your choice. The chosen format must support at least 8 bits per channel and 3 channels. Output A file in the same format, with the same ...
9
votes
2answers
349 views

Summing colored graphs

In some cases, often in physics, you have to sum graphs. Your challenge is to write, in a language of your choice, a program or function that takes multiple graphs as images, calculates all possible ...
19
votes
4answers
1k views

Calculate the size of the moon

The size of the moon mystery I am sure you have heard that the moon changes its size. When you're in love and you're lucky, the moon is almost twice in size compared to normal situations. Some people ...
38
votes
3answers
1k views

Sometimes I need a Lossless Screenshot Resizer

Sometimes I need to write more documentation than just comments in code. And sometimes, those explanations need screenshots. Sometimes the conditions to get such a screenshot are so weird that I ask a ...
0
votes
2answers
248 views

Create a Scalable Valentine's Day Heart [closed]

Happy Valentine's Day! To celebrate this day of love and happiness (or sadness and loneliness for those of us who are single...), let's write some code to create some hearts! Specifically, if you ...
10
votes
2answers
786 views

Build a Mining Robot

Your program will control a mining robot searching underground for valuable minerals. Your robot will tell the controller where you want to move and dig, and the controller will provide feedback on ...
3
votes
1answer
335 views

Warhol these pictures [closed]

We've all seen the famous painting of Marilyn Monroe created by Andy Warhol. Let's try to replicate that effect with the usual suspects. Your task is to write a program/programs that do one or ...
14
votes
2answers
869 views

Go and make it starry

In this contest you have to write a program, that accepts a black and white pixel image, and tries to alter it, such that the white shape forms star domain, with as few changes as possible. Allowed ...
44
votes
3answers
3k views

Computer Generated Textured Wall Paint

The paint on the walls in my room has a random, almost fractal-like, 3-dimensional texture: In this challenge you will write a program that generates random images that look like they could be part ...
13
votes
1answer
375 views

Robot roadie needed to pack the truck

As the band's roadie, you have to pack the truck. Your program will place the packages so that they fit in the smallest height. A badly packed truck Rules Packages may be rotated through ...
33
votes
4answers
2k views

Image Battle of Colours

CONGRATULATIONS to @kuroineko for the best entry and winning the 200 bounty from @TheBestOne (excellent sportsmanship!). Write a program to colour as much of an image as possible before opposition ...
15
votes
4answers
1k views

10, 10, 10… I hope?

Preface As I was shooting an archery 900 round earlier today (10 ends at 6 arrows an end, and 10 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this ...
68
votes
5answers
5k views

Recognise Stack Exchange Sites by Their Icon

After spending a while on Stack Exchange, I can recognise most sites in the Hot Network Questions by their little icon (which is also their favicon), but certainly not all of them. Let's write a ...
40
votes
4answers
3k views

Paint by Numbers

You're given a true colour image. Your task is to generate a version of this image, which looks like it was painted using paint-by-numbers (the children's activity, not nonograms). Along with the ...