Updated .gitignore file.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@
|
||||
*.blg
|
||||
*.bbl
|
||||
*.aux
|
||||
/latex_verze/*.pdf
|
||||
|
14
src/main.py
14
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)
|
||||
|
Reference in New Issue
Block a user