Skip to content

Commit

Permalink
added more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres committed Nov 9, 2018
1 parent f5fcaa8 commit 4b4f5e2
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ImageManipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def change_background(image, background):
except:
pass

if green >70 and red > 10 and blue > 30 and blue < 60 and red < 60: # greenscreen
if green > 70 and red > 10 and blue > 30 and blue < 60 and red < 60: # greenscreen
pixels[i,j] = (int(red_b), int(green_b), int(blue_b))

else:
Expand All @@ -59,9 +59,9 @@ def change_background(image, background):
# Main
if __name__ == "__main__":
# Load Image (JPEG/JPG needs libjpeg to load)
original = open_image('test_two.png')
background = open_image('blue.png')
original = open_image('test.png')
background = open_image('eiffel_tower.png')
print('Now converting...')
new = change_background(original, background)
print('Done')
save_image(new, 'converted_test_two.png')
save_image(new, 'converted_test_eiffel_tower.png')
Binary file added blue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added converted_test_eiffel_tower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added converted_test_one_movie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added converted_test_three.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed download.jpg
Binary file not shown.
Binary file added eiffel_tower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added movie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed test_one.png
Binary file not shown.
Binary file added test_three.png
Loading
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 4b4f5e2

Please sign in to comment.