This challenge involves drawing pictures on a screen or generating image files. For pure ASCII art contests, use [ascii-art] instead. If participants can choose between graphics and ASCII art, use both tags. For images as input, use [image-processing].

learn more… | top users | synonyms (1)

26
votes
18answers
4k views

XOR two monochrome images

Challenge: Take input of two black and white (monochrome) images and xor each pixel of the first, with each pixel of the second, add them to a new image and output the new image. Some clarifications:...
31
votes
7answers
1k views

Draw Reutersvärd's Triangle

This impossible object is Reutersvärd's triangle: Draw your own version according to these rules: Exactly 9 cubes total Each side is made up of exactly 4 cubes The cubes appear to overlap such that ...
17
votes
3answers
284 views

Find the identity sandpile

This question is about abelian sandpiles. Read this previous challenge and watch this numberphile video to learn more. An abelian sandpile of size n by n is a grid containing the number 0, 1, 2 and 3 ...
25
votes
3answers
308 views

Generate a Padovan Spiral

Introduction Similar to the Fibonacci Sequence, the Padovan Sequence (OEIS A000931) is a sequence of numbers that is produced by adding previous terms in the sequence. The initial values are defined ...
2
votes
4answers
416 views

A challenge about colours [closed]

Above, you can see an image full of different colours. Click here for a hex-dump. Your task is to create a self-contained program that takes no input, and outputs an image with the same RGBA pixels ...
23
votes
1answer
676 views

A Rather Knotty Conundrum

Write a program to draw a 2-D diagram of a knot based on the knot's structure. A knot is exactly what it sounds like: a loop of rope that's tied up. In mathematics, a knot diagram shows where a piece ...
110
votes
24answers
14k views

Appease Your Google Overlords: Draw the “G” Logo

Write a program or function that takes in a positive integer N, and outputs an N×N pixel image of Google's "G" logo according to this* construction: For example, if N is 400, a 400×...
84
votes
69answers
18k views

Draw the national flag of Iceland

This year's UEFA Euro 2016 is over and besides a couple of negative headlines there has been a very positive surprise as well – the Iceland national football team. Let's draw their national flag. ...
18
votes
8answers
1k views

Arnold's Cat Map

Challenge Given a colour raster image* with the same width and height, output the image transformed under Arnold's cat map. (*details see below) Definition Given the size of the image N we assume ...
10
votes
9answers
872 views

Draw the Hilbert Curve

A Hilbert Curve is a type of space-filling curve, and it basically maps a line to a plane. Each point in the line corresponds to just one point in the plane, and each point in the plane corresponds to ...
17
votes
4answers
540 views

A 2D Traffic Jam

The Biham-Middleton-Levine traffic model is a self-organizing cellular automaton that models simplified traffic. It consists of a number of cars represented by points on a lattice with a random ...
22
votes
1answer
263 views

It's factors all the way down!

This challenge is inspired by this fantastic animated diagram (thanks to flawr for posting it in chat). Given an input n, draw all of its prime factors as nested polygons of dots, as specified. For ...
26
votes
8answers
1k views

Simulate a Rubik's cube

A Rubik's cube has 6 colors: red, orange, yellow, white, blue, and green. Red and orange, yellow and white, and blue and green faces are on opposite sides. Net of a solved Rubik's cube looks like ...
17
votes
12answers
544 views

Random Pixel Poking

Your task is simple: write a program that will replace random pixels in a black 16px * 8px rectangle (width by height) with a white pixel. The holes must be uniformly random, and you should output ...
19
votes
25answers
1k views

Print all colorings of a 3x3 grid

You have a 3x3 grid. Each cell can be colored black or white. Display all 512 of these colorings. Fewest bytes wins. You can display the grids in any formation as long as they are visually separated ...
30
votes
1answer
573 views

Gasket Weaving - draw a Sierpiński knot

Given an integer N >= 2, produce an image showing a Sierpiński knot of degree N. For example, here are knots of degree 2, 3, 4 and 5: Click on the images to view full size (the higher the degree the ...
37
votes
23answers
2k views

Lined up circle, n points

Draw lines between every pair of distinct points for n points arranged in a circle, producing something like the below result. Shortest code (in bytes) wins! Your lines don't have to be transparent, ...
33
votes
6answers
2k views

Plotting the Cornu spiral

The Cornu Spiral can be calculated using Feynman's method for path integrals of light propagation. We will approximate this integral using the following discretisation. Consider a mirror as in this ...
12
votes
4answers
266 views

Output subdivisions of international standard paper sizes

ISO Paper Sizes Defined: The A series paper sizes are defined by the following requirements: The length divided by the width is the square root of 2. The A0 size has an area of 1 unit. Each ...
35
votes
4answers
3k views

Create a bad pixel

Your task is to write a program that makes your screen appear to have a bad pixel. You should choose exactly one pixel on the screen, and exactly one channel between red, green and blue, and make its ...
15
votes
10answers
731 views

Steganographic Squares

Steganographic Squares Your job is to take in a string, and generate an NxN image that represents this string. You must also write the algorithm that takes in the image and turns it back into a ...
109
votes
49answers
23k views

GO OUT AND VOTE

Today is November 8th, 2016, Election Day in the United States of America. If you are a U.S. citizen eligible to vote, then go out and vote if you haven't already before answering this challenge. Do ...
18
votes
12answers
833 views

Draw a Dragon Curve

You task for today: draw a dragon curve! In case you don't know what a Dragon Curve is, here is an introductory ViHart video (Really cool, please watch!) Your task: draw a dragon curve, iterated at ...
37
votes
41answers
7k views

A single pixel moving in a circular path

This is a graphical output challenge where the task is to give the shortest code per language. Task Your code should plot a single purple pixel (hex value #800080 or rgb(128, 0, 128)), moving ...
29
votes
6answers
2k views

I really wanted a rhombus, but all I got was this stupid rectangle

Given only a straightedge and compass, inscribe a rhombus inside the given rectangle, sharing two opposite points. Input Input is the dimensions of the rectangle. In the example shown, that would be ...
18
votes
2answers
454 views

Downgoat-ify Animals!

My Downgoat avatar has several distinct features These features can however also apply to any other animal. Specification Given an image of an animal (technically can be anything), you must apply ...
16
votes
4answers
1k views

Golfing Flower of Life

The challenge here is to accurately depict the flower of life (which is a sacred geometrical figure according to some) in the language of your choice. The design consists an arrangement of circles ...
21
votes
2answers
4k views

Generate Newton fractals

You all know the Newton method to approximate the roots of a function, don't you? My goal in this task is to introduce you into an interesting aspect of this algorithm. Newton's algorithm converges ...
7
votes
3answers
877 views

Catenary Between Two Points (Hanging Chain)

This is one of several challenges left for the community by Calvin's Hobbies. The curve that an idealised hanging rope or chain makes is a catenary. Image by Bin im Garten, via Wikimedia Commons. ...
1
vote
0answers
46 views

Draw the Serpinski Triangle [duplicate]

For today's fractal challenge, draw at least 5 iterations of Sierpinski's triangle! (Shown below is Sierpinski's trinagle) The resolution of the image must be sufficent that the smallest triangles ...
6
votes
0answers
125 views

Out Steganograph Me! [duplicate]

Out Steganograph Me As a follow up to this challange, I want to see competitive algorithms for encoding strings as images, and then decoding them. The Challenge Your goal is to write a function or ...
72
votes
28answers
10k views

Mandelbrot image in every language

I always used a Mandelbrot image as the 'graphical' version of Hello World in any graphical application I got my hands on. Now it's your guys' turn. Language must be capable of graphical output or ...
327
votes
44answers
93k views

Images with all colors

Similar to the images on allrgb.com, Make images where each pixel is a unique color (no color is used twice and no color is missing). Give a program that generates such an image, along with a ...
20
votes
8answers
700 views

Generate a modulo rosace

The cool stuff The following rosace can help calculate numbers modulo 7. In order to do that, you must start at 0 and turn clockwise a number of steps given by the first digit. Then, for each ...
100
votes
7answers
3k views

Exponentially Slimy Programming: Stacking Minecraft Slimes

Slimes are cube shaped enemies in Minecraft that break into multiple smaller versions of themselves when killed. For the purposes of this challenge we'll depict them as an 8×8 pixel image with 3 ...
190
votes
34answers
28k views

Paint Starry Night, objectively, in 1kB of code

Below is a 386x320 png representation of van Gogh's Starry Night. Your goal is to reproduce this image as closely as possible, in no more than 1024 bytes of code. For the purposes of this challenge, ...
16
votes
20answers
5k views

Draw a regular polygon

The goal of this code golf is to draw a regular polygon (one with equal side lengths) given the number of sides and radius (distance from center to vertex). The number of sides and the radius can be ...
12
votes
4answers
529 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): The ...
7
votes
2answers
373 views

Outline a PNG image

Intro (semi fictional) I'm the solo developer of a game, I'm already struggling with character design as is. Hence I've thought of a smart solution, I'll just use images for regular monsters, outline ...
97
votes
75answers
16k views

Draw the national flag of France

There have been many other flag challenges posted but not one for the national flag of France. This week seems like an appropriate time. Produce this flag in the fewest bytes possible: The image ...
22
votes
29answers
4k views

Draw the rainbow

The challenge is simple: Draw a rainbow in as few bytes as possible The specs for the rainbow are as follows: The figure must be exactly 400 pixels wide and 200 pixels high (optionally 401x201 if ...
47
votes
9answers
9k views

Draw the South Korean flag

When I stumbled upon this question I remembered that I had also once seen precise rules for the construction of the South Korean flag. And this is quite a different construction. Source: Wikipedia ...
4
votes
1answer
318 views

Fabulous glamour shot

Found this picture on the web today. Being a lazy programmer, I don't want to actually open google and type a couple of characters. Way too much work! This is such an important task that it should be ...
16
votes
0answers
701 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 ...
27
votes
1answer
454 views

Build an aesthetically pleasing divisor tree

An aesthetically pleasing divisor tree is a tree of divisors of input n that, for any composite number m, has two children nodes that are the pair of divisors that are closest to the square root of m. ...
7
votes
5answers
566 views

Draw the Union Jack

Preface There are many "draw x flag" challenges, and upon searching it turns out there are no challenges to draw the union Jack! I feel like this would be a harder flag to draw but it should still be ...
8
votes
4answers
518 views

The Great, White, North!

Eh! You know, the problem with us Canadians is that sometimes, after a long day of moose hunting and dam repairing, we forget our way back to our cabins! Wouldn't it be great if our handy laptop (...
60
votes
15answers
9k views

Draw the € sign

The goal is to output or display an image with an € (euro) sign according to the following specs (ignoring the border of the sign). Source: http://en.wikipedia.org/wiki/File:Euro_Construction.svg ...
11
votes
2answers
423 views

Animations with all colours

Last year, there was a very popular challenge to create an image containing every 24-bit RGB colour. My challenge is to create a smooth animation (24 frames/s say), where the colour of every pixel of ...
13
votes
16answers
3k 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 ...