# Image (of a function)

The image \(\operatorname{im}(f)\) of a function \(f : X \to Y\) is the set of all possible outputs of \(f\), which is a subset of \(Y\). Using set builder notation, \(\operatorname{im}(f) = \{f(x) \mid x \in X\}.\)

Visualizing a function as a map that takes every point in an input set to one point in an output set, the image is the set of all places where \(f\)-arrows land (pictured as the yellow subset of \(Y\) in the image below).

The image of a function is not to be confused with the codomain, which is the *type* of output that the function produces. For example, consider the Ackermann function, which is a very fast-growing (and difficult to compute) function. When someone asks what sort of thing the Ackermann function produces, the natural answer is not “something from a sparse and hard-to-calculate set of numbers that I can’t tell you off the top of my head”; the natural answer is “it outputs a number.” In this case, the codomain is “number”, while the image is the sparse and hard-to-calculate subset of numbers. For more on this distinction, see the page on codomain vs image.

Okay now I’m also confused. (@5)

Why don’t we just say its codomain is {1}?