from PIL import Image
import numpy as np
from stippler import  choose_k_points, get_probability_matrix,tractor_beam


def load_image(file: str):
    im = Image.open(file).convert('L')
    return im


def image_to_array(img):
    return np.asarray(img)


def array_to_image(arr):
    return Image.fromarray(np.uint8(arr))


input_folder = 'images/input/'
output_folder = 'images/output/'
name = 'art.jpg'
k = 2048
iterations = 1000
im_arr = image_to_array(load_image(input_folder + name))
#output_img = array_to_image(im_arr)
output_img = array_to_image(tractor_beam(im_arr, k=k, iterations=iterations))
output_img.save(output_folder+name)

44dedbaf46559e8fe487cd740513872650655808
<mask token>


def load_image(file: str):
    im = Image.open(file).convert('L')
    return im


def image_to_array(img):
    return np.asarray(img)


def array_to_image(arr):
    return Image.fromarray(np.uint8(arr))


<mask token>

<mask token>


def load_image(file: str):
    im = Image.open(file).convert('L')
    return im


def image_to_array(img):
    return np.asarray(img)


def array_to_image(arr):
    return Image.fromarray(np.uint8(arr))


<mask token>
output_img.save(output_folder + name)

<mask token>


def load_image(file: str):
    im = Image.open(file).convert('L')
    return im


def image_to_array(img):
    return np.asarray(img)


def array_to_image(arr):
    return Image.fromarray(np.uint8(arr))


input_folder = 'images/input/'
output_folder = 'images/output/'
name = 'art.jpg'
k = 2048
iterations = 1000
im_arr = image_to_array(load_image(input_folder + name))
output_img = array_to_image(tractor_beam(im_arr, k=k, iterations=iterations))
output_img.save(output_folder + name)

from PIL import Image
import numpy as np
from stippler import choose_k_points, get_probability_matrix, tractor_beam


def load_image(file: str):
    im = Image.open(file).convert('L')
    return im


def image_to_array(img):
    return np.asarray(img)


def array_to_image(arr):
    return Image.fromarray(np.uint8(arr))


input_folder = 'images/input/'
output_folder = 'images/output/'
name = 'art.jpg'
k = 2048
iterations = 1000
im_arr = image_to_array(load_image(input_folder + name))
output_img = array_to_image(tractor_beam(im_arr, k=k, iterations=iterations))
output_img.save(output_folder + name)

from PIL import Image
import numpy as np
from stippler import  choose_k_points, get_probability_matrix,tractor_beam


def load_image(file: str):
    im = Image.open(file).convert('L')
    return im


def image_to_array(img):
    return np.asarray(img)


def array_to_image(arr):
    return Image.fromarray(np.uint8(arr))


input_folder = 'images/input/'
output_folder = 'images/output/'
name = 'art.jpg'
k = 2048
iterations = 1000
im_arr = image_to_array(load_image(input_folder + name))
#output_img = array_to_image(im_arr)
output_img = array_to_image(tractor_beam(im_arr, k=k, iterations=iterations))
output_img.save(output_folder+name)
