Animations with all colours

11

1

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 every frame is unique. I will also allow duplication of colours as long as every colour appears the same number of times (greater than 0), since otherwise the animation will have to be short, or the frames small.

I have produced some examples here, based on the winning solution to the 2d version. Unfortunately, it seems you can't embed videos, so links will have to do.

sobe86

Posted 2015-09-11T15:22:14.523

Reputation: 111

1

Someone already did an animation in this answer from the linked question. I'm not sure if it meets the criteria, though.

– mbomb007 – 2015-09-11T16:50:51.473

1Bit more technical specs would be nice. What does "create" mean? Render a video to disc? Display a realtime animation? – mınxomaτ – 2015-09-12T16:14:52.997

You could use a gif... – wizzwizz4 – 2015-12-21T19:21:12.553

1@wizzwizz4 a GIF cannot hold more than 256 colors; so you can make a 16x16 image with different colors for every pixel - and have no room left for animation. – Titus – 2016-09-22T10:38:16.170

Answers

4

Mathematica

This is a straightforward implementation with each rgb colour occupying an intersection in a 256 by 256 by 256 unit grid.

The jerkiness seems to be an artefact of the video, not an error in the data, which should be exact.

red values increase downwards, green values increase rightwards, and blue values increase by frame.

Perhaps I'll jumble things up later.

f@b_ := Image@Table[{r, g, b}/255, {r, 0, 255}, {g, 0, 255}]
Export["c.mov", Table[f@b, {b, 0, 255}]]

QuickTime clip

DavidC

Posted 2015-09-11T15:22:14.523

Reputation: 24 524

This is puzzling. It works for me and the permissions are set for anyone to access it. Are you able to play other videos at vimeo.com ? – DavidC – 2015-09-12T19:12:11.333

It does work now, for some reason. – Fatalize – 2015-09-12T19:15:25.850

glad to hear it. – DavidC – 2015-09-12T19:15:45.440

0

PHP (+ HTML) + JavaScript

Part 1
generate 256 images with distinct red values from 0 to 255;
green value=row index, blue value=column index

for($r=$h=256;$r--;){$i=imagecreatetruecolor($g=$h,$h);for(;$g--;)for($b=$h;$b--;)imagesetpixel($i,$g,$b,imagecolorallocate($i,$r,$g,$b));imagepng($i,"$r.png");imagedestroy($i);}

Note: Depending on Your PHP implementation, this may throw an internal server error.
If it does, take the lowest number of the images that already have been created, insert <number>, after $r= and run again.

Part 2
loop through these images from 0 to 255 and back (0 and 255 taking 2 frames each)

<img><script>r=d=0;setInterval(()=>{document.images[0].src=r+".png",(d?!r--:(++r)>=256)?r-=(d=!d)?1:-1:r},40);</script>

Titus

Posted 2015-09-11T15:22:14.523

Reputation: 13 814