I've recently started working on my project of creating an efficient bot to play bejeweled 2, right now i'm stuck on a part in which i want my program to do image recognition, right now the idea is to take a picture of a current board, remove background from it and then tell what gem it is by shape, however when i try running the code using rembg, results were very bad, what should i do to have better results in removing background, heres a code very similiar to the one i tried using in main project (this one was used in testing )
]


from rembg import remove
from PIL import Image
input_path = 'pic1.png'
output_path = 'pic2.png' //not actual names
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
print('done')