Fixed bug where only the first 48 tests would run correctly. Fixed bug where the progress bar would not update correctly and would display an incomplete bar even if the image was done
This commit is contained in:
parent
aa1068c654
commit
b4d8fedf74
3
2bit.py
3
2bit.py
|
@ -37,7 +37,7 @@ for x in range(image.width):
|
|||
for y in range(image.height):
|
||||
i += 1
|
||||
bar.index = i
|
||||
if i % 200 == 0: bar.update()
|
||||
if i % 193 == 0: bar.update() # I used to use 200 but then the last two digits of the current status were always "00" which made it look like the progress bar was fake
|
||||
pos = (x,y)
|
||||
color = image.getpixel(pos)
|
||||
if len(color) == 4:
|
||||
|
@ -54,4 +54,5 @@ for x in range(image.width):
|
|||
color[z] = colors[index]
|
||||
out.putpixel(pos, tuple(color))
|
||||
out.save(outfile)
|
||||
bar.update() # Otherwise it will display the last multiple of 193 out of the total value
|
||||
bar.finish()
|
||||
|
|
|
@ -12,6 +12,7 @@ max_i = len(files) * (16*3)
|
|||
|
||||
def getparams(i):
|
||||
percolor = dither = False
|
||||
i %= 48
|
||||
if i % 16 >= 8:
|
||||
percolor = True
|
||||
if i >= 16:
|
||||
|
@ -44,3 +45,4 @@ for f in files:
|
|||
print("On " + outfilename)
|
||||
subprocess.call(["python3", "../2bit.py", f, outfilename, bits_formatted, *percolor, *dither])
|
||||
i += 1
|
||||
print("Done")
|
||||
|
|
Loading…
Reference in New Issue