Permalink
Browse files

update the code to save to disk and added a new image that shows the …

…result after an application of the filter
  • Loading branch information...
pfdevilliers committed Jun 8, 2012
1 parent fe86eb2 commit 5efb7979ad51691d7ecdf7262e36201c7940eef1
Showing with 4 additions and 4 deletions.
  1. +4 −4 filter.py
  2. BIN images/building_nasn.png
View
@@ -78,7 +78,8 @@ def interpolate(i_arr, f_arr, p, p_c):
# NOTE: Assumes that image_array is a numpy array
image_filter = self.filters[filter_name]
# 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_g = image_filter.get_g()
@@ -114,7 +115,6 @@ def interpolate(i_arr, f_arr, p, p_c):
filter_manager.add_filter(img_filter)
filter_array = filter_manager.apply_filter('crgb', image_array)
-
im = Image.fromarray(filter_array)
- im.show()
-
+ im.save('temp.png')
+ im.show()
View
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.