Skip to content

Commit

Permalink
fix black and white image
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJoin95 committed Apr 15, 2021
1 parent 0f4c28a commit fb93faf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion ImageGoNord/GoNord.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ def open_image(self, path):
pillow image
opened image
"""
return Image.open(path)
opened_image = Image.open(path)
if (type(opened_image.getpixel((0,0))) == int):
opened_image = opened_image.convert('RGB')

return opened_image

def resize_image(self, image, size=(0, 0)):
"""
Expand Down
3 changes: 1 addition & 2 deletions ImageGoNord/palettes/Nord/Aurora.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
#D08770
#EBCB8B
#A3BE8C
#B48EAD

#B48EAD
Binary file added images/bn.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

# E.g. Avg algorithm and less colors
go_nord.enable_avg_algorithm()
go_nord.reset_palette()
# go_nord.reset_palette()
# go_nord.add_file_to_palette(NordPaletteFile.POLAR_NIGHT)
# go_nord.add_file_to_palette(NordPaletteFile.SNOW_STORM)
# go_nord.add_color_to_palette('#FF0000')
go_nord.set_default_nord_palette()
# go_nord.set_default_nord_palette()

image = go_nord.open_image("images/test.jpg")
image = go_nord.open_image("images/bn.jpg")
go_nord.convert_image(image, save_path='images/test.avg.jpg')

# E.g. Resized img no Avg algorithm and less colors
Expand Down

0 comments on commit fb93faf

Please sign in to comment.