Esempio n. 1
0
def example(app: App):
    make_sepia_5()
    make_sepia_10()
    make_sepia_20()
    make_sepia_30()
    make_sepia_40()
    make_sepia_50()
    make_sepia_60()

    data = {
        'title':
        'Sepia algorithm',
        'header':
        'Sepia algorithm with following factors: 5, 10, 20, 30, 40, 50, 60',
        'image_data': [
            ImageData("Factor: 5", "desert_sepia_5.jpg"),
            ImageData("Factor: 10", "desert_sepia_10.jpg"),
            ImageData("Factor: 20", "desert_sepia_20.jpg"),
            ImageData("Factor: 30", "desert_sepia_30.jpg"),
            ImageData("Factor: 40", "desert_sepia_40.jpg"),
            ImageData("Factor: 50", "desert_sepia_50.jpg"),
            ImageData("Factor: 60", "desert_sepia_60.jpg"),
        ]
    }
    app.register_route("/", template_name="main_page.html", **data)
Esempio n. 2
0
def example_bicubic(app: App):
    bicubic_2()
    bicubic_4()

    data = {
        'title': 'Resizing',
        'header': 'Bicubic interpolation',
        'image_data': [ImageData("Scale: 2", "bc_2.jpg"), ImageData("Scale: 4", "bc_4.jpg")]
    }
    app.register_route("/bicubic_interpolation", template_name="main_page.html", **data)
Esempio n. 3
0
def example_nearest_neighbour(app: App):
    neigbhour_2()
    neigbhour_4()

    data = {
        'title': 'Resizing',
        'header': 'Nearest neighbour interpolation',
        'image_data': [ImageData("Scale: 2", "n_2.jpg"), ImageData("Scale: 4", "n_4.jpg")]
    }
    app.register_route("/nearest_neighbour/", template_name="main_page.html", **data)
Esempio n. 4
0
def example(app: App):
    apply_convolution('tests/data/flower.jpg', 'data/flower_convoluted.jpg',
                      filter_kernel)
    data = {
        'title': 'Convolution algorithm',
        'header': ' ',
        'image_data': [
            ImageData("Convoluted image", "flower_convoluted.jpg"),
        ]
    }
    app.register_route("/", template_name="main_page.html", **data)