An iterative method of processing a pixellated image comprising image pixels to retrieve a phase distribution representative of the image in the Fourier domain, the method comprising: padding the image pixels with non-image pixels to form a padded pixellated image with a larger number of pixels than the pixellated image; associating each pixel of the padded pixellated image with a random phase value to form a first data set having plural elements, each element having amplitude information and random phase information; and iterations of the following steps: performing a Fourier transform of the first data set to produce a second data set having plural elements, each element having amplitude and phase information; quantising phase information from the second data set by setting phase information of each element at one of a discrete number of phase levels; forming a third data set having plural elements, each element having amplitude and phase information which represents the phase distribution, the phase information being the quantised phase information from the second data set and; inverse Fourier transforming the third data set to produce a fourth data set having plural elements, each element having amplitude and phase information; overwriting the amplitude information of the fourth data set to produce a fifth data set having plural elements, each element having phase information of the fourth data set and overwritten amplitude information, wherein overwriting comprises processing first elements corresponding to the non-image pixels differently to second elements corresponding to the image pixels by attenuating the amplitude information of each first element by an attenuation factor β and by processing the amplitude information of each second element utilising a gain factor α; and using the fifth data set as the first data set of the next iteration. padding the image pixels with non-image pixels to form a padded pixellated image with a larger number of pixels than the pixellated image; associating each pixel of the padded pixellated image with a random phase value to form a first data set having plural elements, each element having amplitude information and random phase information; and iterations of the following steps: performing a Fourier transform of the first data set to produce a second data set having plural elements, each element having amplitude and phase information; quantising phase information from the second data set by setting phase information of each element at one of a discrete number of phase levels; forming a third data set having plural elements, each element having amplitude and phase information which represents the phase distribution, the phase information being the quantised phase information from the second data set and; inverse Fourier transforming the third data set to produce a fourth data set having plural elements, each element having amplitude and phase information; overwriting the amplitude information of the fourth data set to produce a fifth data set having plural elements, each element having phase information of the fourth data set and overwritten amplitude information, wherein overwriting comprises processing first elements corresponding to the non-image pixels differently to second elements corresponding to the image pixels by attenuating the amplitude information of each first element by an attenuation factor β and by processing the amplitude information of each second element utilising a gain factor α; and using the fifth data set as the first data set of the next iteration. performing a Fourier transform of the first data set to produce a second data set having plural elements, each element having amplitude and phase information; quantising phase information from the second data set by setting phase information of each element at one of a discrete number of phase levels; forming a third data set having plural elements, each element having amplitude and phase information which represents the phase distribution, the phase information being the quantised phase information from the second data set and; inverse Fourier transforming the third data set to produce a fourth data set having plural elements, each element having amplitude and phase information; overwriting the amplitude information of the fourth data set to produce a fifth data set having plural elements, each element having phase information of the fourth data set and overwritten amplitude information, wherein overwriting comprises processing first elements corresponding to the non-image pixels differently to second elements corresponding to the image pixels by attenuating the amplitude information of each first element by an attenuation factor β and by processing the amplitude information of each second element utilising a gain factor α; and using the fifth data set as the first data set of the next iteration.