From 304d8549369e883b58ee833efcec2905578802a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rostislav=20L=C3=A1n?= Date: Mon, 5 Dec 2022 15:50:35 +0100 Subject: [PATCH] Updated .gitignore file. --- .gitignore | 1 + src/main.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a27de03..eec9b91 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ *.blg *.bbl *.aux +/latex_verze/*.pdf diff --git a/src/main.py b/src/main.py index c42d3fb..f3a281b 100644 --- a/src/main.py +++ b/src/main.py @@ -14,15 +14,22 @@ import filters as flt class apply_filters: def __init__(self): + # Parse and save arguments. self.parse_arguments() self.input_file = self.args.input_file self.output_file = self.args.output_file + self.dpi = self.args.dpi # should be around 500-1000dpi + self.filters = self.args.filters + + # Read input image, save its dimensions self.img = plt.imread(self.input_file) self.dimensions = self.img.shape self.print_debug(self.dimensions) - self.dpi = self.args.dpi # should be around 500-1000dpi + + # Convert dimensions self.convert_dpi() - self.filters = self.args.filters + + # Apply all filters self.apply_filter() def parse_arguments(self): @@ -64,7 +71,6 @@ class apply_filters: filter.apply(self) else: for filter_name in self.filters: - # only one takse effect? filter = self.filter_factory(filter_name) filter.apply(self) self.save_image() @@ -75,7 +81,7 @@ class apply_filters: #print("Channels: " + str(dimensions[2])) def save_image(self): - # Save processed image + ''' Save processed image. ''' plt.xticks([]), plt.yticks([]) plt.axis('off') plt.savefig(self.output_file)