# How to convert 3D rgb to grascale

**URL:** https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908
**Category:** Beginner Questions
**Tags:** simpleitk
**Created:** [April 12, 2022, 1:45pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908 "2022-04-12T13:45:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![assia855](https://discourse.itk.org/user_avatar/discourse.itk.org/assia855/32/2642_2.png) [@assia855](https://discourse.itk.org/u/assia855)
#### Post date: [April 12, 2022, 1:45pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/1 "2022-04-12T13:45:34Z")

</div>

Hello Folks, I’m searching for how to convert my 3D data to grayscale. I can’t find how on the documentation. Thanks in advance.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 12, 2022, 1:49pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/2 "2022-04-12T13:49:16Z")

</div>

[ConvertRGBImageToGrayscaleImage example](https://itk.org/ITKExamples/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/Documentation.html) is the first hit for Google search `itk rgb to grayscale`.

---

<div class="post-metadata">

### Author: ![assia855](https://discourse.itk.org/user_avatar/discourse.itk.org/assia855/32/2642_2.png) [@assia855](https://discourse.itk.org/u/assia855)
#### Post date: [April 12, 2022, 1:51pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/3 "2022-04-12T13:51:10Z")

</div>

Thanks for the answer, but does it work as well for 3D

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 12, 2022, 1:51pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/4 "2022-04-12T13:51:36Z")

</div>

Yes, it should work just as well for 3D or other nD images.

---

<div class="post-metadata">

### Author: ![assia855](https://discourse.itk.org/user_avatar/discourse.itk.org/assia855/32/2642_2.png) [@assia855](https://discourse.itk.org/u/assia855)
#### Post date: [April 12, 2022, 1:52pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/5 "2022-04-12T13:52:12Z")

</div>

Thanks

---

<div class="post-metadata">

### Author: ![assia855](https://discourse.itk.org/user_avatar/discourse.itk.org/assia855/32/2642_2.png) [@assia855](https://discourse.itk.org/u/assia855)
#### Post date: [April 12, 2022, 2:06pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/6 "2022-04-12T14:06:36Z")

</div>

Unfortunately, this does not work on my 3D data.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 12, 2022, 2:13pm UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/7 "2022-04-12T14:13:12Z")

</div>

Did you change `Dimension = 2` into `Dimension = 3`? If so, what is the problem?

---

<div class="post-metadata">

### Author: ![assia855](https://discourse.itk.org/user_avatar/discourse.itk.org/assia855/32/2642_2.png) [@assia855](https://discourse.itk.org/u/assia855)
#### Post date: [April 19, 2022, 10:38am UTC](https://discourse.itk.org/t/how-to-convert-3d-rgb-to-grascale/4908/8 "2022-04-19T10:38:07Z")

</div>

It works. thanks a lot.
