Digital image processing allows us to analyze the wealth of data captured by modern telescopes and satellites, and it provides access to the enormous data contained in astronomical databases. This lecture with computer exercises covers the fundamentals of image processing such as image enhancement, image restoration, color image processing, wavelet and multi-resolution processing, morphological image processing, image segmentation, and object recognition. In addition, a variety of techniques, commonly used in astronomy and astrophysics, will be introduced: optical flow measurements, speckle interferometry, phase diversity techniques, and Doppler imaging, among others.