#22 développement du pourcentage de contamination

This commit is contained in:
2025-08-19 09:44:59 +02:00
parent f5be43767a
commit b0efeff809
15 changed files with 101 additions and 97 deletions

View File

@@ -1,5 +1,14 @@
class_name ImageTools
static func get_color_coverage(image: Image, color: Color = Color.WHITE):
var pixel_color_count = 0.
for x in range(image.get_width()):
for y in range(image.get_height()):
if image.get_pixel(x, y) == color:
pixel_color_count += 1.
return pixel_color_count/(image.get_width()*image.get_height())
static func draw_circle(image: Image, center: Vector2i, length: int, color: Color = Color.WHITE):
for x in range(image.get_width()):
for y in range(image.get_height()):