Cubify This! A lesson in grayscale... er... color... er... whatever
Imagemagick (108)

Version: ImageMagick 6.8.7-7 Q16 x86_64 2013-11-27

The following call:

$ convert -resize 75x75 -fx "q=p.intensity;q&lt;1/6?#0051BA:q&lt;2/6?#C41E3A:q&lt;3/6?#009e60:q&lt;4/6?#ff5800:q&lt;5/6?#FFD500:#FFF" input output


where input and output have to be modified for the input and output filename.

I only counted the chars between -resize and #FFF", if you think this is invalid feel free to comment.

I used Lenna as image (she appeared in a Playboy, and anyone doing that should count as a Hollywood celebrity, right?)

Input:



Output:

$ convert -resize 75x75 -fx "q=p.intensity;q&lt;1/6?#0051BA:q&lt;2/6?#C41E3A:q&lt;3/6?#009e60:q&lt;4/6?#ff5800:q&lt;5/6?#FFD500:#FFF" Lenna.png LennaRubik.png




Output enlarged:



Notes: according to the imagemagick docs you cannot have more than one conditional operator in a statement, but the call still seems to work fine, so probably this was fixed and the docs were just not updated.

Running identify on the result image (to show the colors are indeed fine):

$ identify -verbose LennaRubik.png
  (...)   
  Colors: 6
  Histogram:
       338: (  0, 81,186) #0051BA srgb(0,81,186)
      1652: (  0,158, 96) #009E60 srgb(0,158,96)
      1187: (196, 30, 58) #C41E3A srgb(196,30,58)
      1674: (255, 88,  0) #FF5800 srgb(255,88,0)
       706: (255,213,  0) #FFD500 srgb(255,213,0)
        68: (255,255,255) #FFFFFF white
  (...)


If you think Lenna doesn't count as a proper celebrity, here is Bruce Willis: