#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 19 19:03:20 2025

@author: pjoulaud
"""

from PIL import Image
img = Image.open("IMG_RAW.CR2")
L, H = img.size
D = 1500
img2 = Image.new("RGB", (L, H))
for l in range(L):
    for h in range(H):
        r, v, b = img.getpixel((l,h))
        if 170<r<210 and 170<v<210 and 140<b<185:
            img2.putpixel((l, h), (0,0,0))
        else : 
            img2.putpixel((l, h), (r,v,b))
            
img2.show()