This paper proposes a new lossless encryption algorithm for color images based on a six-dimensional (6D) hyperchaotic system and the two-dimensional (2D) discrete wavelet transform (DWT). Different from the current image encryption methods, our image encryption scheme is constructed using the 2D DWT and 6D hyperchaotic system in both the frequency domain and the spatial domain, where the key streams depend on not only the hyperchaotic system but the plain-image. In the presented algorithm, the plain-image is firstly divided into four image sub-bands by means of the 2D DWT. Secondly, the sub-bands are permutated by a key stream, and then the size of them is decreased by a constant factor. Thirdly, the 2D inverse DWT is employed to reconstruct an intermediate image by the four encrypted image sub-bands. Finally, to further enhance the security, the pixel values of the intermediate image are modified by using another key stream. Experimental results and security analysis demonstrate that the proposed algorithm has a high security, fast speed and can resist various attacks.