diff --git a/lib/galaxy/tool_util/verify/__init__.py b/lib/galaxy/tool_util/verify/__init__.py
index cac554dd0b7..66dda2ceda4 100644
--- a/lib/galaxy/tool_util/verify/__init__.py
+++ b/lib/galaxy/tool_util/verify/__init__.py
@@ -595,6 +595,12 @@ def files_image_diff(file1: str, file2: str, attributes: Optional[Dict[str, Any]
if arr1.shape != arr2.shape:
raise AssertionError(f"Image dimensions did not match ({arr1.shape}, {arr2.shape}).")
+ # Handle `bool` images by converting them to `uint8`
+ if numpy.issubdtype(arr1.dtype, bool):
+ arr1 = arr1.astype(numpy.uint8)
+ if numpy.issubdtype(arr2.dtype, bool):
+ arr2 = arr2.astype(numpy.uint8)
+
distance = get_image_metric(attributes)(arr1, arr2)
distance_eps = attributes.get("eps", DEFAULT_EPS)
if distance > distance_eps:
diff --git a/lib/galaxy/tool_util/verify/asserts/image.py b/lib/galaxy/tool_util/verify/asserts/image.py
index daf4ab8e70c..4bbedbc324d 100644
--- a/lib/galaxy/tool_util/verify/asserts/image.py
+++ b/lib/galaxy/tool_util/verify/asserts/image.py
@@ -747,8 +747,14 @@ def _get_image_labels(
label = label.strip()
if numpy.issubdtype(im_arr.dtype, numpy.integer):
return int(label)
- if numpy.issubdtype(im_arr.dtype, float):
+ if numpy.issubdtype(im_arr.dtype, numpy.floating):
return float(label)
+ if numpy.issubdtype(im_arr.dtype, bool):
+ label_lower = label.lower()
+ if label_lower in ("0", "1", "false", "true"):
+ return label_lower in ("1", "true")
+ else:
+ raise AssertionError(f'Label "{label}" incompatible with label type "{im_arr.dtype}"')
raise AssertionError(f'Unsupported image label type: "{im_arr.dtype}"')
# Determine labels present in the image.
diff --git a/test-data/im3_b_bool.tiff b/test-data/im3_b_bool.tiff
new file mode 100644
index 00000000000..dceefdea1d2
Binary files /dev/null and b/test-data/im3_b_bool.tiff differ
diff --git a/test/functional/tools/image_diff.xml b/test/functional/tools/image_diff.xml
index addb4ef24b4..d6d9f9b1ffb 100644
--- a/test/functional/tools/image_diff.xml
+++ b/test/functional/tools/image_diff.xml
@@ -27,6 +27,11 @@
+
+
+
+
+
diff --git a/test/functional/tools/validation_image.xml b/test/functional/tools/validation_image.xml
index c94c3581c3f..f1b139e55a2 100644
--- a/test/functional/tools/validation_image.xml
+++ b/test/functional/tools/validation_image.xml
@@ -181,6 +181,20 @@
+
+
+
+