Painting in Millions of Colors
Painting in Millions of Colors
Written by David Conrad   
Sunday, 09 March 2014

A recent contest challenged devs to come up with a program to create an image that contains all the RGB colors exactly once. It produced some stunning results and the winner, by popular vote, was Jozsef Fejes with his Rainbow Smoke image.

The challenge, set on the StackExchange site Programming Puzzles & Code Golf, sounds simple until you start to think about the constraints:

  • Create the image purely algorithmically

  • Image must be 256×128 (or grid that can be screenshot and saved at 256×128)

  • Use all 15-bit colors, that is the 32768 colors that can be made by mixing 32 reds, 32 greens, and 32 blues

Other stipulations were no embedded images or external input,  web queries, URLs or databases.

The contest lasted 7 days and attracted entries in several languages including Processing, Java, Python and C++. You can view the code as well as the images produced on Programming Puzzles & Code Golf.

Participants were asked to vote for:

the most beautiful images made by the most elegant code and/or interesting algorithm.

The winner with 144 votes was Hungarian programmer Jozsef Fejes using C#. His entry explanation states:

I put a random pixel in the middle, and then start putting random pixels in a neighborhood that most resembles them. Two modes are supported: with minimum selection, only one neighboring pixel is considered at a time; with average selection, all (1..8) are averaged. Minimum selection is somewhat noisy, average selection is of course more blurred, but both look like paintings actually.

But that was just the start. Fejes found he could not "stop playing" and went on the use hi-res, rendering 24-bit colour and displaying 16,777,216 pixels in the image.



 (click to view higher-res version)



  (click to view higher-res version)


On his blog Fejes outlines his progress from 15-bit images, through 18-bits and 21-bits to 24 bit. Moreover. he has released his source code under GPL on and produced a You Tube video that has gone viral:

Fejes explains:

Naturally, video compression destroys the possibility of accurately having all colors exactly once. This video was made to just look spectacular, to show how the images are made. There are some bad video artifacts around 2:35. Sorry, please don't look too closely and blame YouTube for that.

He adds:

The song is Pachabelly by Huma Huma, from the YouTube audio library.

You can also buy prints of the two versions of Rainbow Smoke.




Frontiers Of Knowledge Award

The 10th Edition of the BBVA Foundation Frontiers of Knowledge Award in the Information and Communication Technologies category goes to Shafi Goldwasser, Silvio Micali, Ronald Rivest and Adi Shamir fo [ ... ]

MongoDB Finds Devs Held Back By Maintenance and Admin

Research commissioned by MongoDB has revealed that while developers are recognised as the key drivers of enterprise innovation they are so heavily burdened with upkeep of infrastructure that their tal [ ... ]

More News

Last Updated ( Sunday, 09 March 2014 )

RSS feed of news items only
I Programmer News
Copyright © 2018 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.