Skip to content

Commit

Permalink
updated to use np.array(fig.canvas.buffer_rgba() and changed reshape …
Browse files Browse the repository at this point in the history
…to 4 channel
  • Loading branch information
Dean DeLongchamp committed Dec 22, 2024
1 parent 0341c10 commit fdaa935
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NRSS/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ def morphology_visualizer(

if outputmat and (i in outputmat):
fig.canvas.draw()
rgb_return = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
rgb_return = rgb_return.reshape(fig.canvas.get_width_height()[::-1] + (3,))
rgb_return = np.array(fig.canvas.buffer_rgba(), dtype=np.uint8)
rgb_return = rgb_return.reshape(fig.canvas.get_width_height()[::-1] + (4,))
if outputplot and ("vfrac" in outputplot):
if outputaxes:
fig_xl = ax1.get_tightbbox().intervalx[0].astype(int)
Expand Down

0 comments on commit fdaa935

Please sign in to comment.