Are 2D grayscale images actually 3D? I keep running into this issue when describing the dimensionality of data I work with. In general, it's a question of whether or not the 3D time series we are handling are in fact 5D, but I guess the issue can be even more simply represented when thinking of images:
A 2D image might be flat, i.e. 2D, but each pixel has a value. A 2D image can't be represented as points 2D space, it consists of points in 3D space, of which one dimension is represented via intensity, and the other two remain spatial. So am I correct to say that a planar section of brightness data is 3D?
If so, what's the correct way to disambiguate this. Is it 3D data and a 2D image? What about for a 3D space, is it a 3D space but 4D data? and for the 3D timeseries I am dealing with? While 5D might be a correct description, it might actually be a bit confusing.
 A: It depends what you mean by "dimension" - you can think of a given image as existing in two dimensions, because it describes brightness varying across a two dimensional surface. You could think of it as existing in three dimension, like a graph of the brightness function. However, the bare notion of "dimension" would usually refer to the dimension of the space of images, which has a far higher dimension.

Though the theory changes a bit between digital and analog images, the basic idea of an image is that we have some space $R$; in the analog domain, this might be an actual rectangle, whereas it might be a grid of finitely many pixels in the digital domain. At each point in the space, there is some brightness. So, an image can be represented as a function
$$f:R\rightarrow I$$
where $I$ is a set of possible intensities - usually something like the non-negative real numbers or a closed interval.
Typically, it will be true that $R$ has two dimensions - its supposed to be a rectangle, after all. So, an image is two-dimensional in the sense that it is a function with domain having two dimensions. The codomain has dimension one - so you can, as you do, imagine the image's data as being encapsulated in the graph of $f$ - that is, the tuples $(r,f(r))$ for $r\in R$. These tuples live in three dimensional space. In this sense, a single gray scale image represents some three dimensional object. A good precise way to think about this is that "a grayscale image can represent a function taking in two dimensions of input and spitting out one dimension of output." The assignment of a number to this notion is not necessarily helpful.
A related question, however, is how many degrees of freedom one has in creating a grayscale image. Equivalently, how many dimensions do you need to represent such an image? The answer to this is that it has one dimension for every pixel in $R$, because you can independently prescribe the values at every pixel. This leads to very high dimensions very quickly. Formally, this is the dimension of the space of all images - and for many applications (e.g. data analysis or machine learning), this is really the most useful definition of dimension. You can interpret this answer as, "It requires $|R|$ numbers to define an image."
