Skip to content

Commit

Permalink
Merge pull request #154 from djhoese/bugfix-stretch-int-overflow
Browse files Browse the repository at this point in the history
Fix stretch when min/max value it outside input data type
  • Loading branch information
djhoese committed Nov 26, 2023
2 parents a84299f + ba55be6 commit 00c175b
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 163 deletions.
16 changes: 6 additions & 10 deletions doc/examples/utilities-examples.py
@@ -1,22 +1,18 @@
"""Example showing importing colormaps from on-disk files."""
from trollimage import utilities as tu


#
# Examples: importing colormaps
#
filename='setvak.rgb'
# Examples: importing colormaps
filename = 'setvak.rgb'
my_cmap = tu.cmap_from_text(filename)
print(my_cmap.colors)
my_cmap_norm = tu.cmap_from_text(filename, norm=True)
print(my_cmap_norm.colors)
my_cmap_transp = tu.cmap_from_text(filename,norm=True, transparency=True)
my_cmap_transp = tu.cmap_from_text(filename, norm=True, transparency=True)
print(my_cmap_transp.colors)
filename='hrv.rgb'
my_cmap_hex = tu.cmap_from_text(filename,hex=True)
filename = 'hrv.rgb'
my_cmap_hex = tu.cmap_from_text(filename, hex=True)
print(my_cmap_hex.colors)

#
# Example: converting PIL to trollimage.Image
#
image = "pifn.png"
timage = tu.pilimage2trollimage(image)

0 comments on commit 00c175b

Please sign in to comment.