An optical processing device, comprising: a plurality of optical ports; a dispersion element for spatially dispersing an optical beam received from the optical ports into a plurality of wavelength components; a lens arrangement for focusing the wavelength components received from the dispersion element; an optical path conversion system for receiving the focused plurality of wavelength components from the lens arrangement and selectively directing at least one of the wavelength components to one of the optical ports, said optical path conversion system including a digital micromirror device, said DMD performing optical processing on the wavelength component when it is reflected from the DMD; characterized by an optical path length compensator for adjusting an optical path length traversed by the wavelength component selectively directed to one of the optical ports to improve the optical processing performed on the wavelength component, and in that at least one wavelength component is reflected at least twice from the DMD before being directed to a selected one of the optical ports, wherein said optical processing is performed when the wavelength component is reflected form the DMD a first or second time, and in that the lens arrangement focuses the plurality of wavelength components onto the DMD when the plurality of wavelength components are reflected the first time from the DMD and the optical path length compensator is adapted to optimize an optical path length of wavelength components selectively directed from the optical path conversion system to a selected output in accordance with an optical path length of wavelength components received by one of the optical ports and directed to the optical path conversion system.. a plurality of optical ports; a dispersion element for spatially dispersing an optical beam received from the optical ports into a plurality of wavelength components; a lens arrangement for focusing the wavelength components received from the dispersion element; an optical path conversion system for receiving the focused plurality of wavelength components from the lens arrangement and selectively directing at least one of the wavelength components to one of the optical ports, said optical path conversion system including a digital micromirror device, said DMD performing optical processing on the wavelength component when it is reflected from the DMD; characterized by an optical path length compensator for adjusting an optical path length traversed by the wavelength component selectively directed to one of the optical ports to improve the optical processing performed on the wavelength component, and in that at least one wavelength component is reflected at least twice from the DMD before being directed to a selected one of the optical ports, wherein said optical processing is performed when the wavelength component is reflected form the DMD a first or second time, and in that the lens arrangement focuses the plurality of wavelength components onto the DMD when the plurality of wavelength components are reflected the first time from the DMD and the optical path length compensator is adapted to optimize an optical path length of wavelength components selectively directed from the optical path conversion system to a selected output in accordance with an optical path length of wavelength components received by one of the optical ports and directed to the optical path conversion system..