# Path: pixelsort/constants.py



from PIL import Image, ImageFilter
from pixelsort import constants
from pixelsort import util
import random as rand


def edge(pixels, image, angle):
    img = Image.open(image)
    img = img.rotate(angle, expand=True)
    edges = img.filter(ImageFilter.FIND_EDGES)
    edges = edges.convert('RGBA')
    edge_data = edges.load()

    filter_pixels = []
    edge_pixels = []
    intervals = []

    
    for y in range(img.size[1]):
        filter_pixels.append([])
        for x in range(img.size[0]):
            filter_pixels[y].append(edge_data[x, y])

    
    for y in range(len(pixels)):
        edge_pixels.append([])
        for x in range(len(pixels[0])):
            if util.lightness(filter_pixels[y][x]) < 0.25:

# Path: pixelsort/constants.py



# Path: pixelsort/interval.py
from PIL import Image, ImageFilter
from pixelsort import constants
from pixelsort import util
import random as rand



def edge(pixels, image, angle):
    img = Image.open(image)
    img = img.rotate(angle, expand=True)
    edges = img.filter(ImageFilter.FIND_EDGES)
    edges = edges.convert('RGBA')
    edge_data = edges.load()

    filter_pixels = []
    edge_pixels = []
    intervals = []

    
    for y in range(img.size[1]):
        filter_pixels.append([])
        for x in range(img.size[0]):
            filter_pixels[y].append(edge_data[x, y])

    
    for y in range(len(pixels)):
        edge_pixels.append([])
        for x in range(len(pixels[0])):
            if util.lightness(filter_pixels[y][x]) < 0.25:

                edge_pixels[y].append(constants.white_pixel)