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

Writing RGB neuroglancer image with png compression #209

Open
LarsKoeppel opened this issue Dec 4, 2024 · 0 comments
Open

Writing RGB neuroglancer image with png compression #209

LarsKoeppel opened this issue Dec 4, 2024 · 0 comments

Comments

@LarsKoeppel
Copy link

Hi,

I'm trying to write an RGB image using TensorStore with PNG compression, but I'm encountering some issues. The resulting image looks strange—similar to subpixels on a display. I've attached images showing the problem (split into individual channels for clarity):

  • Red Channel
    Image

  • Green Channel
    Image

  • Blue Channel
    Image

For reference, here's how the image is supposed to look:
Image

Here's the code snippet I'm using:

tensorstore::Open({{"driver", "neuroglancer_precomputed"},
     {"kvstore", {
          {"driver", "file"},
          {"path", <path>}
      }},
     {"multiscale_metadata", {
          {"data_type", "uint8"},   
          {"num_channels", 3},
          {"type", "image"},
      }},
     {"scale_metadata", {
          {"resolution", {resolution[0], resolution[1], resolution[2]}},
          {"encoding", "png"},
          {"png_level", 6},
          {"chunk_size", {1024, 1024, 1}},
          {"size", {sizeX, sizeY, 1}},
      }},
     {"scale_index", 0},
    },
    context,
    tensorstore::OpenMode::create,
    tensorstore::RecheckCached{false},
    tensorstore::ReadWriteMode::write).value();

When I use the same code with a single-channel image, everything works fine.

Am I doing something wrong?
Any help or guidance would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant