You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pxl_oboard/remove_back.py

22 lines
424 B

from tqdm import tqdm
def optimize(l):
back = input("Enter background color > ")
new_l = []
for i in tqdm(l):
if i[2] == back:
continue
else:
new_l.append(i)
f = open("out.txt", "w")
f.write(str(new_l))
f.close()
print(f"Lenght before: {len(l)}")
print(f"Lenght after: {len(new_l)}")
optimized = len(l)-len(new_l)
print(f"Optimized: {optimized} ( -{round(optimized/(len(l)/100))}% )")
return new_l