Summary description here.
Images and Color Maps¶
- Functions for displaying images and consistant color maps across
: 0-1 float32 RGB with label code annotations 0 to 2550-255 int8 scaler data with appliet cmap
: images to look the same in matplotlib and in system image viewer
LABEL_COLORMAP_RGB & LABEL_COLORMAP_RGBA¶
plot_images({'RGB':np_open_image(TEST_JPG), 'PNG':np_open_image(TEST_PNG)}, figsize=(12, 5))
Showing the first 50 colors, which repeat in stepes of 20, with the first black
cmap_show()
Loading and saving greyscale uint8 images with LABEL_COLORMAP_RGB
print("Save test image")
grd = np.linspace(0, 50, 50);
grd = np.vstack((grd, grd, grd, grd)).astype(np.uint8)
show_img(grd, mode='P', axis_on=True)
plt.tight_layout()
# save_png_p(np.resize(grd,(200,200)), 'images/save_png_p_test.png', cmap='hot')
save_png_p(grd, 'images/save_png_p_test.png')
print("Load test image to compare color maps")
img = np_open_image('images/save_png_p_test.png')
show_img(img, mode='P', axis_on=True)
plt.tight_layout()