Skip to content

Commit db09cc2

Browse files
author
Antonio
committed
housekeeping and minor changes
1 parent b31e508 commit db09cc2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tupper.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
import mpmath as mp
1818
import matplotlib.pyplot as plt
19-
from matplotlib.transforms import Bbox
2019
import numpy as np
2120
from PIL import Image
22-
import sys
2321
import os
2422

2523
mp.mp.dps = 1000 # increasing the precision of mpmath
@@ -103,7 +101,7 @@ def bmp_to_number(self, pic_path: str) -> mp.mpf:
103101
# Indexed mode 2 bit
104102
img = img.convert(mode='1')
105103

106-
#Resizing and transposing
104+
# Resizing and transposing
107105
img = img.resize((self.height, self.width))
108106
img = img.transpose(Image.ROTATE_270)
109107

@@ -113,7 +111,7 @@ def bmp_to_number(self, pic_path: str) -> mp.mpf:
113111
for j in range(0, self.width):
114112
bstr += str(int(img.getpixel((j, i)) < 100))
115113

116-
return mp.mpmathify(int(bstr, 2))*self.width
114+
return mp.mpmathify(int(bstr, 2)) * self.width
117115

118116

119117
if __name__ == '__main__':

0 commit comments

Comments
 (0)