# Which filter to use to convert from 16 bit image to 8 bit Image

**URL:** https://discourse.itk.org/t/which-filter-to-use-to-convert-from-16-bit-image-to-8-bit-image/7158
**Category:** Beginner Questions
**Created:** [August 7, 2024, 6:19pm UTC](https://discourse.itk.org/t/which-filter-to-use-to-convert-from-16-bit-image-to-8-bit-image/7158 "2024-08-07T18:19:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)
#### Post date: [August 7, 2024, 6:19pm UTC](https://discourse.itk.org/t/which-filter-to-use-to-convert-from-16-bit-image-to-8-bit-image/7158/1 "2024-08-07T18:19:58Z")

</div>

Sort of having a brain fart today but what is the ITK Filter I am looking for that would change from a 16 bit image to an 8 bit image? is that a simple ITKImageCast? I feel like that isn’t correct because if I have values greater than 255 there would be an issue. I need a filter that actually rescales the data into the range of the target byte sizes before the cast down to the new type.

Thanks

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [August 7, 2024, 6:38pm UTC](https://discourse.itk.org/t/which-filter-to-use-to-convert-from-16-bit-image-to-8-bit-image/7158/2 "2024-08-07T18:38:56Z")

</div>

Hello @imikejackson,

[RescaleIntensity](https://itk.org/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html) or [IntensityWindowing](https://itk.org/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html) with the target range being [0,255] followed by [CastImage](https://itk.org/Doxygen/html/classitk_1_1CastImageFilter.html). Depends on whether you want to map the whole original range into 256 values or just a subrange of the original values.
