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 of the colors. 


Print the color code in hex RGB, that is a hash sign # followed by 2 digits for R, 2 digits for G and 2 digits for B. (#xxxxxx where x can be 0-9, A-F and/or a-f).
The hex code shall be followed by a space  and the decimal pixel count, then a newline (\n or \r\n). 
The list shall be sorted by count descending (most frequent color at the top).
If there's a tie (two colors with the same amount), the order is not important.
The image will not contain transparency, so any alpha value is not important. The alpha value may not be part of the output.
An image size of 4000x3000 must be supported (that may matter to type definitions)


Sample image "10red 20blue 30black 40white": 

Expected output:

#FFFFFF 40
#000000 30
#0000FF 20
#FF0000 10


Sample image "blue gradient": 

One of the expected outputs (since the order of same colors may vary):

#718DFF 19
#5571FF 15
#3855FF 11
#8DAAFF 11
#1C38FF 7
#AAAAFF 7
#8D8DFF 6
#AAC6FF 6
#C6C6FF 5
#C6E2FF 4
#001CFF 3
#E2E2FF 3
#FFFFFF 3


Sample image "testImage", kindly provided by @Luis Mendo: 



Expected output:

#FFFFFF 18042
#000000 1754
#FF3300 204


Similar to this question, but the output is text, not an image.
Bash + coreutils, 54

7 bytes saved thanks to @manatwork


grep -oE '#\w+'|sort|uniq -c|sort -nr|awk '$0=$2&quot; &quot;$1'

This assumes STDIN input of Imagemagick's .txt format.
Ideone.

If the above input format is too much of a stretch, then we can add Imagemagick conversion from any format:
Bash + coreutils + Imagemagick, 71
convert $1 txt:-|grep -oE '#\w+'|sort|uniq -c|sort -nr|awk '$0=$2&quot; &quot;$1'

Here, the input image filename is passed in as a command-line parameter.