scikit-image/scikit-image — pull request #1079 by blink1073 (2014-07-22 00:55:01+00:00)
Title: Fix holes in lab conversions and add tests

While working on the M&M color segmentation gallery example, we noticed that lab conversion was not working as expected. Turns out, there are some LAB (and correspondingly XYZ) values that yield a negative RGB channel. An example is LAB (50, -12, 85). Also, there are some LAB values that have no corresponding XYZ value, as they result in a Z < 0. An example is LAB (10, -12, 85).

This PR mimics the behavior at [EasyRGB](http://www.easyrgb.com/index.php?X=CALC#Result), which is to truncate RGB values at 0, and to refuse to convert invalid LAB values. Invalid values result in a warning, and those pixels being set to NaN. I added two tests to cover the new behavior.