Skip to content

Commit

Permalink
Merge pull request #1445 from girder/improve-docs
Browse files Browse the repository at this point in the history
Improve style docs.
  • Loading branch information
manthey authored Jan 25, 2024
2 parents c7e130d + 7d59ba9 commit 78fa459
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion docs/tilesource_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ A band definition is an object which can contain the following keys:

- ``max``: the value to map to the last palette value. Defaults to 255. 'auto' to use 0 if the reported minimum and maximum of the band are between [0, 255] or use the reported maximum otherwise. 'min' or 'max' to always uses the reported minimum or maximum. 'min:<threshold>' and 'max:<threshold>' pick a value that excludes a threshold amount from the histogram; for instance, 'max:0.02' would exclude at most the brightest 2% of values by using an appropriate value for the maximum based on a computed histogram with some default binning options. 'auto:<threshold>' works like auto, though it applies the threshold if the reported maximum would otherwise be used. 'full' uses a value based on the data type of the band. This will be 1 for a float data type and 65535 for a uint16 datatype.

- ``palette``: This is a list or two or more colors. The values between min and max are interpolated using a piecewise linear algorithm or a nearest value algorithm (depending on the ``scheme``) to map to the specified palette values. It can be specified in a variety of ways:
- ``palette``: This is a single color string, a palette name, or a list of two or more colors. The values between min and max are interpolated using a piecewise linear algorithm or a nearest value algorithm (depending on the ``scheme``) to map to the specified palette values. It can be specified in a variety of ways:

- a list of two or more color values, where the color values are css-style strings (e.g., of the form #RRGGBB, #RRGGBBAA, #RGB, #RGBA, or a css ``rgb``, ``rgba``, ``hsl``, or ``hsv`` string, or a css color name), or, if matplotlib is available, a matplotlib color name, or a list or tuple of RGB(A) values on a scale of [0-1].

- a single string that is a color string as above. This is functionally a two-color palette with the first color as solid black (``#000``), and the second color the specified value

- a named color palette from the palettable library (e.g., ``matplotlib.Plasma_6``) or, if available, from the matplotlib library or one of its plugins (e.g., ``viridis``).

- ``scheme``: This is either ``linear`` (the default) or ``discrete``. If a palette is specified, ``linear`` uses a piecewise linear interpolation, and ``discrete`` uses exact colors from the palette with the range of the data mapped into the specified number of colors (e.g., a palette with two colors will split exactly halfway between the min and max values).
Expand Down
14 changes: 7 additions & 7 deletions large_image/tilesource/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ def __init__(self, encoding: str = 'JPEG', jpegQuality: int = 95,
maximum otherwise. 'min' or 'max' to always uses the
reported minimum or maximum. 'full' to use the maximum
value of the base data type (either 1, 255, or 65535).
:palette: a list of two or more color strings, where color
strings are of the form #RRGGBB, #RRGGBBAA, #RGB, #RGBA, or
any string parseable by the PIL modules, or, if it is
installed, byt matplotlib. Alternately, this can be a
single color, which implies ['#000', <color>], or the name
of a palettable paletter or, if available, a matplotlib
palette.
:palette: a single color string, a palette name, or a list of
two or more color strings. Color strings are of the form
#RRGGBB, #RRGGBBAA, #RGB, #RGBA, or any string parseable by
the PIL modules, or, if it is installed, by matplotlib. A
single color string is the same as the list ['#000',
<color>]. Palette names are the name of a palettable
palette or, if available, a matplotlib palette.
:nodata: the value to use for missing data. null or unset to
not use a nodata value.
:composite: either 'lighten' or 'multiply'. Defaults to
Expand Down

0 comments on commit 78fa459

Please sign in to comment.