|
|
|
@ -3,8 +3,8 @@ import scipy.misc as smp |
|
|
|
|
from PIL import Image |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bit_on = [255, 255, 255] # RGB value if bit is 1 |
|
|
|
|
bit_off = [0, 0, 0] # RGB value if bit is 0 |
|
|
|
|
bit_on = [191, 191, 191] # RGB value if bit is 1 |
|
|
|
|
bit_off = [17, 16, 21] # RGB value if bit is 0 |
|
|
|
|
|
|
|
|
|
def translate_bit_color(bit:str): |
|
|
|
|
if( bit == "1" ): |
|
|
|
@ -19,7 +19,10 @@ def data_to_matrix(data:list) -> np.array: |
|
|
|
|
return col_array |
|
|
|
|
|
|
|
|
|
def generate(inp:list) -> None: |
|
|
|
|
print("Converting data to matrix...") |
|
|
|
|
col_array = data_to_matrix(inp) |
|
|
|
|
|
|
|
|
|
print("Generating image...") |
|
|
|
|
img = Image.fromarray(col_array, "RGB") |
|
|
|
|
img.save("ascii_bin-image.jpg") |
|
|
|
|
print("Generated image \"ascii_bin-image.jpg\"") |