In this paper we introduce compressed commuting graph of rings.
It can be seen as a compression of the standard commuting graph
(with the central elements added) where we identify the vertices that
generate the same subring. The compression is chosen in such a way
that it induces a functor from the category of rings to the category
of graphs, which means that our graph takes into account not only
the commutativity relation in the ring, but also the commutativity
relation in all of its homomorphic images. Furthermore, we show that
this compression is best possible for matrix algebras over finite fields,
i.e. it compresses as much as possible while still inducing a functor.
We compute the compressed commuting graphs of finite fields and
rings of 2 × 2 matrices over finite fields.