I think you want to convert 2D image to 3D image. If so, you need to make virtual diection (z direction). Because there is no knowledge about z, so you just can create a virtual 3D image. The best way in this, I think you can make z just like the shadow. It depends on the angle of light. This is easy problem in geometry. For real 3D Image, you cannot do it.
If you mean “3D” is colorful, so you can use cat function of Matlab to combine single color channel to make colorful image.
I think you want to convert 2D image to 3D image. If so, you need to make virtual diection (z direction). Because there is no knowledge about z, so you just can create a virtual 3D image. The best way in this, I think you can make z just like the shadow. It depends on the angle of light. This is easy problem in geometry. For real 3D Image, you cannot do it.
If you mean “3D” is colorful, so you can use cat function of Matlab to combine single color channel to make colorful image.