-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix neuroglancer_precomputed image encoding issues
Previously, the neuroglancer_precomputed driver incorrectly encoded jpeg and png-format chunks in the case that the x and y dimensions of the chunk size differ. In particular, the chunks were encoded with the y dimension specified as the width, and x * z specified as the height, but in fact the data was stored with the x dimension as the inner-most dimension. While all pixels were stored in the correct linear order, and could be decoded properly by both tensorstore and neuroglancer, the image data was misaligned to image rows, such that individual chunks did not display correctly in a normal image viewer, and compression performed poorly due to this misaligned. While png is lossless and poor compression merely increases the size, with jpeg this also tended to introduce extreme artifacts. This commit also enables support for 16-bit PNG images with up to 4 channels. Fixes google/neuroglancer#677. PiperOrigin-RevId: 708415255 Change-Id: I057cc3fc4f073026e8bf96cc543be5a769c626c2
- Loading branch information
1 parent
4e07c92
commit a5a9613
Showing
7 changed files
with
124 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters