We develop X-ray microscopy techniques and x-ray optics for synchrotron radiation sources and x-ray free-electron lasers. A key strength of hard X rays is their large penetration depth in matter that allows one to image the inside of an object without destructive sample preparation. Tomographic scanning modes yield 3D information of the sample. Various X-ray analyical contrasts, such as X-ray fluorescence, diffraction, and absorption, can be used to obtain local elemental, structural, or chemical information. In this way physical and chemical processes can be followed in-situ or under working conditions inside special sample environments, such as chemical reactors. It is our goal to push X-ray microscopy to the limits, improving the spatial and temporal resolution as well as the sensitivity of the techniques.