Tagged Questions

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

22 views

Reverse Bayer Filter of an image

Almost all digital camera sensors are organized in a grid of photosensors. Each photo sensor is sensitive for one of the primary colors: red, green and blue. The way those photo sensors are organized ...
180 views

Thwart Lepton compression [closed]

Related meta post: Objective computational challenges without “code” Dropbox recently released Lepton, a method that losslessly compresses JPEG images round-trip, saving an average of 22%. ...
193 views

Monitorize an Image [closed]

The Problem: This challenge comes from a real problem I was having. I have a dual monitor setup at work, and I wanted to use the following image as my wallpaper: However, my monitors have quite ...
1k views

“Add one” to every color in an image

You would simply take this image and make every color added one to every hexadecimal digit. For example, #49de5f would become #5aef60 (with the 9 looping to an a, and the f looping to a 0.) This ...
833 views

Computer Generated Cracked Soil

Write a program that takes in an integer from 0 to 65535 (216-1) and generates a unique 500×500 pixel image that looks as similar as possible to these 6 real life images of cracked soil: ...
257 views

Color count, sorted by occurences

This one is simple to describe and I could hardly believe that this was not golfed before: For a given image (whatever format is supported by your language), find the unique colors and output a list ...
408 views

Image Hide-and-Seek

In this challenge, you need to find a specific pixel within an photograph (taken with a real camera). You are passed an (R, G, B) tuple and an image, and you need to return a point (x,y) within the ...
427 views

Get the most dominant color!

In this challenge, your task is to write a program that takes in an image and returns the most dominant color in it. Dominant color here means the color with which most of the image is covered (see ...
248 views

Reconstruct a missing RGB channel

Look at these photographs of natural scenes, with one of the RGB channels taken out of them: Source (with red): https://en.wikipedia.org/wiki/File:Altja_j%C3%B5gi_Lahemaal.jpg Source (with green)...
1k views

Rainbowlify An Image

This challenge is about gradually shifting hues in an image to make pretty pictures like this: (original) Challenge Write a program or function that takes in two non-negative integers and an image ...
219 views

How many shapes are in this picture?

Children are very good at classifying objects and counting them. Computers seem to have more trouble. This is a simplified version of this problem. Can you write a small program that can classify and ...
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 ...
956 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 ...
705 views

Generate ASCII Art

Given a black-and-white image in any reasonable lossless format as input, output ASCII art that is as close to the input image as possible. Rules Only linefeeds and ASCII bytes 32-127 may be used. ...
227 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 ...
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 ...
178 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 ...
562 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 ...
14k 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: ...
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 ...
740 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 ...
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 ...
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 ...
188 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 (...
351 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 ...
219 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 ...
985 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 ...
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 ...
609 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 ...
414 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): ...
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 ...
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 ...
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 ...
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 ...
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 ...
400 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 ...
757 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 ...
127 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 ...
924 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 ...
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 ...
746 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) ...
742 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 ...
493 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. ...
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 ...
652 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 ...
777 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 ...
872 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 src="https://ajax.googleapis....
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 ...