Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting the expected full alpha value on some float tiles #1735

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading