We present an algorithm for binary image transformation using chaotic maps. Because of its random-like behavior, chaos is a good candidate for encryption. We show that a two-dimensional discrete time dynamical system with one positive Lyapunov exponent allows the transformation of the image in an unpredictable manner. The suggested algorithm acts on the pixel position, where the diffusion property resulting from the sensitivity to the initial states is used to accomplish the transformation in a random-like way. The suggested algorithm uses three types of keys: Initial state, external parameters and the number of iterations. Using the so-called Henon map as an example, we show that the algorithm produces almost uncorrelated images even when the keys are slightly changed, making it an attractive and fast method for image encryption.