Skip to content

Commit

Permalink
update the code to save to disk and added a new image that shows the …
Browse files Browse the repository at this point in the history
…result after an application of the filter
  • Loading branch information
pfdevilliers committed Jun 8, 2012
1 parent fe86eb2 commit 5efb797
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions filter.py
Expand Up @@ -78,7 +78,8 @@ def interpolate(i_arr, f_arr, p, p_c):
# NOTE: Assumes that image_array is a numpy array # NOTE: Assumes that image_array is a numpy array
image_filter = self.filters[filter_name] image_filter = self.filters[filter_name]
# NOTE: What happens if filter does not exist? # NOTE: What happens if filter does not exist?
filter_array = numpy.zeros(image_array.shape, dtype=float) width,height,channels = image_array.shape
filter_array = numpy.zeros((width, height, 3), dtype=float)


p_r = image_filter.get_r() p_r = image_filter.get_r()
p_g = image_filter.get_g() p_g = image_filter.get_g()
Expand Down Expand Up @@ -114,7 +115,6 @@ def interpolate(i_arr, f_arr, p, p_c):
filter_manager.add_filter(img_filter) filter_manager.add_filter(img_filter)


filter_array = filter_manager.apply_filter('crgb', image_array) filter_array = filter_manager.apply_filter('crgb', image_array)

im = Image.fromarray(filter_array) im = Image.fromarray(filter_array)
im.show() im.save('temp.png')

im.show()
Binary file added images/building_nasn.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5efb797

Please sign in to comment.