Skip to content

i.his.rgb: add test file #5660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jayneel-shah18
Copy link
Contributor

@jayneel-shah18 jayneel-shah18 commented May 15, 2025

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. #5659

@echoix
Copy link
Member

echoix commented May 20, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imagery module Python Related code is in Python tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants