WOLFRAM LANGUAGE TUTORIAL
Importing Graphics and Sounds
The Wolfram Language allows you not only to export graphics and sounds, but also to import them. With Import you can read graphics and sounds in a wide variety of formats, and bring them into the Wolfram Language as Wolfram Language expressions.
|Import["name.ext"]||import graphics from the file in a format deduced from the file name|
|Import["file","format"]||import graphics in the specified format|
|ImportString["string","format"]||import graphics from a string|
Importing graphics and sounds.
This imports an image stored in JPEG format.
This shows an array of four copies of the image.
This imports a sound stored in a WAV file.
Import yields expressions with different structures depending on the type of data it reads. Typically you will need to know the structure if you want to manipulate the data that is returned.
|Image[data,opts]||resolution‐dependent bitmap images|
Structures of expressions returned by Import.
This shows the overall structure of the graphics object imported above.
This extracts the array of pixel values used.
Here are the dimensions of the array.
This shows the distribution of pixel values.
This shows a transformed version of the image.