def avg_filter(filename: str, size: int): img = ImageFilter(filename) fname = img.avg_filter(size=size) pix = QPixmap(fname) os.remove(fname) return pix pass
def sobel(filename: str, hence: bool): img = ImageFilter(filename) fname = img.sobel(hence) pix = QPixmap(fname) os.remove(fname) return pix
def prewitt(filename: str, hence: bool): img = ImageFilter(filename) fname = img.prewitt(hence) pix = QPixmap(fname) os.remove(fname) return pix
def canny(filename: str, low: int, high: int): img = ImageFilter(filename) fname = img.canny(low=low, high=high) pix = QPixmap(fname) os.remove(fname) return pix
def gauss(filename: str, sigma: float, size: int): img = ImageFilter(filename) _, fname = img.gauss(sigma, size) pix = QPixmap(fname) os.remove(fname) return pix
def laplace(filename: str, area: int, hence: bool): img = ImageFilter(filename) fname = img.laplacian(area, hence) pix = QPixmap(fname) os.remove(fname) return pix