In this recipe, we will load a sample image of Lena, which is available in the SciPy distribution, into an array. This chapter is not about image manipulation, by the way; we will just use the image data as an input.
Lena Soderberg appeared in a 1972 Playboy magazine. For historical reasons, one of those images is often used in the field of image processing. Don't worry; the image in question is completely safe for work.
We will resize the image using the
repeat() function. This function repeats an array, which means resizing the image by a certain factor in our use case.
A prerequisite for this recipe is to have SciPy, matplotlib, and PIL installed. Take a look at the corresponding recipes in this chapter and Chapter ...