Skip to content

Commit

Permalink
Added colour and colourbar to generated thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Sevak committed Dec 13, 2023
1 parent e6c421c commit 76d3d44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions uncoverml/interface_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json

import numpy as np
import matplotlib.pyplot as plt

from pathlib import Path
from PIL import Image
Expand Down Expand Up @@ -84,9 +85,12 @@ def create_thumbnail(config, res_type):
data = src.read(1)

stretched_data = stretch_raster(data)
out_image = Image.fromarray(stretched_data.astype('uint8'), 'L')
fig, ax = plt.subplots()
plt.imshow(stretched_data)
plt.colorbar()
out_file = res_dir / f'{res_type}_thumbnail.png'
out_image.save(str(out_file))
fig.tight_layout()
fig.savefig(out_file)
print(str(out_file))


Expand Down

0 comments on commit 76d3d44

Please sign in to comment.