Skip to content

Commit

Permalink
Logi minor update (#38)
Browse files Browse the repository at this point in the history
Provide the script to do the color inversion
  • Loading branch information
milkschen authored Jan 5, 2023
1 parent 9655767 commit 797aea4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file modified figures/levioSAM_S_bw_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions invert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import matplotlib.image as mpimg
import matplotlib.image
import numpy as np


img = mpimg.imread('figures/levioSAM_S_bw.png')
img2 = []
for irow, row in enumerate(img):
img2.append([])
for cell in row:
if sum(cell) != 4:
img2[-1].append([1, 1, 1, 1])
else:
img2[-1].append([1-cell[0], 1-cell[1], 1-cell[2], 1.])
matplotlib.image.imsave('figures/levioSAM_S_bw_dark.png', img2, dpi=300)

0 comments on commit 797aea4

Please sign in to comment.