Skip to content
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

i.rgb.his: add test file #5437

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

Conversation

jayneel-shah18
Copy link
Contributor

This PR introduces comprehensive regression tests for the i.rgb.his GRASS GIS module. The tests cover a variety of scenarios to ensure accurate conversions from RGB to HIS color space.

Changes Made

  • Implemented tests for:
    • Output value ranges validation (test_output_ranges)
    • Grayscale conversion accuracy (test_grayscale_conversion)
    • Primary color conversion for red, green, and blue (test_pure_primary_colors)

Key Features Tested

  • Range Validation: Confirm that hue, intensity, and saturation values remain within the valid range of 0 to 255.
  • Grayscale Conversion: Ensure accurate saturation and intensity results for grayscale inputs.
  • Primary Colors: Validate correct hue assignments for pure red, green, and blue channels.

Performance

  • Windows: 2.615s
  • Ubuntu: 2.279s
  • macOS: 2.086s

This PR enhances the reliability of the i.rgb.his module by providing test coverage. Looking forward to feedback and potential refinements!

@github-actions github-actions bot added Python Related code is in Python module imagery tests Related to Test Suite labels Mar 24, 2025
]
)

univar = gs.parse_command("r.univar", map="test_intensity_gray", format="json")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about hue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hue is undefined for grayscale images, that is why I have not included it in the test.

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