While it has always been possible to do image manipulation in Mathematica, several new features in Version 4.0 make it quick, easy, and fun.
First you need to import an image. Fortunately, Version 4.0 includes a powerful
Given just the file name, Mathematica looks in several directories (the one containing Mathematica itself, your home directory, etc.). If the file is not located in one of these standard locations, you may need to include the full path name to locate the file. For example, owners of the electronic edition of  can use the following command to load a picture of a very cute puppy (used throughout this article).
Or, the following command can be used to import any file on your disk (you will get an open-file dialog box in which you can choose the file to import).
Graphics[ Raster[data,pixelrange,valuerange, ColorFunction->RGBColor], AspectRatio->Automatic]
where data is a two-dimensional list of triplets (red, green, blue), pixelrange represents the dimensions of the image, and valuerange represents the minimum and maximum values of the numbers in the data. This expression is intentionally constructed in such a way that the standard
In this article, we're going to assume you're using an RGB color image such as a JPEG.
Converted by Mathematica April 21, 2000