# Reading exact value of a pixel in an indexed (colormap) image

**URL:** <https://discourse.julialang.org/t/reading-exact-value-of-a-pixel-in-an-indexed-colormap-image/125467>\
**Category:** New to Julia\
**Tags:** images\
**Created:** [February 2, 2025, 2:01am UTC](https://discourse.julialang.org/t/reading-exact-value-of-a-pixel-in-an-indexed-colormap-image/125467 "2025-02-02T02:01:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgagnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dgagnon/32/45466_2.png) [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Post date:** [February 2, 2025, 2:01am UTC](https://discourse.julialang.org/t/reading-exact-value-of-a-pixel-in-an-indexed-colormap-image/125467/1 "2025-02-02T02:01:15Z")

</div>

Hello

I have a tiff file with pixel values in one byte and a color table. When I read the file I can display the RGB value of any pixel but want I want is the exact value of the pixel. This is a classified image and I don’t really care about the color table which is arbitrary. The class of the pixel is given by the byte value. Thia is what I need to get. I understood that `IndirectArrays` are used to do the class-\>RGB conversion, but I can’t figure out how to read the value without the colormap conversion.

For instance

```julia
julia> img[1,1]
RGB{N0f16}(0.67059, 0.42353, 0.15686)

```

So it seems to be 16bits pixels. But from the size of the image and the size of the file, I can clearly see that the pixels are coded with 1 byte only. Which make sense given that the image has about 16 classes.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![eldee](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@eldee](https://discourse.julialang.org/u/eldee)\
**Post date:** [February 2, 2025, 9:26am UTC](https://discourse.julialang.org/t/reading-exact-value-of-a-pixel-in-an-indexed-colormap-image/125467/2 "2025-02-02T09:26:34Z")

</div>

Hi,

It sounds like you’re looking for `rawview` (or `reinterpret`): [Conversions vs. views · JuliaImages](https://juliaimages.org/latest/tutorials/conversions_views/#Views-for-%22converting%22-between-fixed-point-and-raw-representations)

---

<div class="post-metadata">

**Author:** ![dgagnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dgagnon/32/45466_2.png) [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Post date:** [February 2, 2025, 11:31am UTC](https://discourse.julialang.org/t/reading-exact-value-of-a-pixel-in-an-indexed-colormap-image/125467/3 "2025-02-02T11:31:54Z")

</div>

Thanks for pointing me in the right direction.  
The documentation for images is a bit overwhelming.
