Based on an improved random number generator which is designed mainly by Gauss error function and digital discarding technology, a multi-rounds image encryption algorithm is proposed and implemented in this paper. The structure of the thesis is mainly composed of three modules: The first one is the random number generation module, and the second one is the pixel encryption module and the last one is the algorithm implementation module. First, the chaotic sequence derived from a first-order time-delay differential equation is mapped to another sequence by using the improved Gauss error function, and then the data are truncated and recombined to obtain the random numbers. After scrambling the pixels of the original image by using the generated random numbers, the first round encrypted pixels can be obtained by performing XOR operation between the scrambled pixel sequence and another sequence which derived from the improved random number generator. And then, the generator is used for the next round encryption after selecting an encrypted pixel value of the previous round. Finally, the implementation methods of encryption algorithm in embedded hardware are discussed, and two prototypes are developed on STM32. Simulation experiments demonstrate that this cryptosystem is secure enough to resist brute force attacks, differential attacks, entropy attacks, and statistical attacks. In addition, the cryptosystem has high key sensitivity and large key space.