Skip to content

Commit

Permalink
Merge pull request #1735 from girder/full-alpha
Browse files Browse the repository at this point in the history
Adjusting the expected full alpha value on some float tiles
  • Loading branch information
manthey authored Dec 5, 2024
2 parents d20a338 + 84cf7c8 commit f8293ff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 1.30.5

### Changes

- Adjust how compositing is done on styled images by adjusting the expected full alpha value ([#1735](../../pull/1735))

## 1.30.4

### Bug Fixes
Expand Down
6 changes: 6 additions & 0 deletions large_image/tilesource/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,12 @@ def fullAlphaValue(arr: Union[np.ndarray, npt.DTypeLike]) -> int:
dtype = np.dtype(dtype)
if cast(np.dtype, dtype).kind == 'u':
return np.iinfo(dtype).max
if isinstance(arr, np.ndarray) and cast(np.dtype, dtype).kind == 'f':
amax = np.amax(arr)
if amax > 1 and amax < 256:
return 255
if amax > 1 and amax < 65536:
return 65535
return 1


Expand Down
8 changes: 5 additions & 3 deletions sources/multi/large_image_source_multi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,12 @@ def _lazyImport():
'sampleScale is applied',
'type': 'number',
},
'style': {'type': 'object'},
'style': {
'description': 'A style specification to pass to the base tile source',
'type': 'object',
},
'params': {
'description':
'Additional parameters to pass to the base tile source',
'description': 'Additional parameters to pass to the base tile source',
'type': 'object',
},
},
Expand Down

0 comments on commit f8293ff

Please sign in to comment.