Skip to content

Commit

Permalink
fix: convert logos to grayscale
Browse files Browse the repository at this point in the history
  • Loading branch information
loiccoyle committed Sep 21, 2024
1 parent 8399f38 commit 900f674
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tinyticker/tickers/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def _get_logo(self):
# remove transparancy make it white
background = Image.new("RGBA", img.size, (255, 255, 255))
img = Image.alpha_composite(background, img)
return img
# convert to greyscale but keep 3 channels
return img.convert("L").convert("RGB")
except Exception:
return False

Expand Down
3 changes: 2 additions & 1 deletion tinyticker/tickers/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def _get_logo(self) -> Union[Image.Image, Literal[False]]:
# remove transparancy make it white
background = Image.new("RGBA", img.size, (255, 255, 255))
img = Image.alpha_composite(background, img)
return img
# convert to greyscale but keep 3 channels
return img.convert("L").convert("RGB")

def _get_yfinance_start_end(self) -> Tuple[pd.Timestamp, pd.Timestamp]:
end = utils.now()
Expand Down

0 comments on commit 900f674

Please sign in to comment.