grass icon indicating copy to clipboard operation
grass copied to clipboard

i.his.rgb: add test file

Open jayneel-shah18 opened this issue 7 months ago • 1 comments

This PR introduces a dedicated regression test suite for the 'i.his.rgb` module in GRASS. The tests are designed to validate the correctness of HIS to RGB conversion across multiple well-defined input cases and ensure that key functionalities behave as expected under controlled conditions.

Tests Included

  • test_grayscale: Verifies that when saturation = 0, all three RGB bands match the intensity input. It confirms correct handling of grayscale logic.

  • test_primary_colors: Tests pure hue-to-RGB conversions at full intensity and saturation.

    • Red hue (0°): R = 255, G = 0, B = 0
    • Green hue (120°): G = 255, R = 0, B = 0
    • Blue hue (240°): B = 255, R = 0, G = 0
    • This test checks the mathematical correctness of the hue-to-RGB interpolation at key reference angles.
  • test_mask_handling: Confirms that the module respects raster masks by validating that only unmasked regions are processed.

Looking forward to feedback.

The tests fail currently due to bugs in implementation. https://github.com/OSGeo/grass/issues/5659

jayneel-shah18 avatar May 15 '25 22:05 jayneel-shah18

Are you at the developer summit? If so, come see me tomorrow, I think I have an excel file with other known special values that are mathematically easy to calculate (like by hand), and can check if there's some inversions between the r g and b values. I'll have to double check that these previous hand done calculations are indeed for the correct color space though.

echoix avatar May 20 '25 01:05 echoix