Determine which of two ImageMagick .TXT images is more saturated You have two images (64x64 pixels each):

 

Your program must take the file names of each of them as command line arguments and determine which has more average saturation among their pixels.

The images are in ImageMagick .txt format.  You can download and convert these images using convert pic.png pic.txt or download the raw text (saturated, desaturated)

Ignore the first line of the file (required).

Solutions in Assembly get 50% of their characters for free.  Brainfuck, whitespace, and close variants, get 25% of their characters for free.  (e.g. if it takes 200 characters in Brainfuck; mark it as 200-50=150.)

Describe your output.  It could be the name of the more saturated image; the index of it (0 for first, 1 for second); true for the first, false for the second, etc.  Just let us know.

It should be able to take either the saturated or desaturated image first, and accurately report the more saturated (test both ways).  The filenames shouldn't be considered when evaluating saturation (e.g. no if filename contains 'desaturated'...)

Shortest answer wins.  Happy coding :-)
bash etc. and Image Magick (136 chars)

for x in "$@";do convert "$x" -colorspace HSL -channel G -separate -scale 1x1 t.txt
echo `sed "1d;s%.*#\(..\).*%\1%" t.txt` $x;done|sort


The way I see it, the easiest way to deal with the complexities of the Image Magick file format is to let Image Magick do it. t.txt seems to be the shortest possible filename which guarantees the correct output file format. The first 4 " could arguably be removed, but that would decrease robustness in the face of filenames with spaces in.

Sample output:

$ ./cmpsat.sh img-sat.txt img-desat.txt rose:
24 img-desat.txt
69 rose:
FE img-sat.txt