In this paper, we study the dimension theory of a class of piecewise affine systems in euclidean spaces suggested by Michael Barnsley, with some applications to the fractal image compression. It is a more general version of the class considered in the work of Keane, Simon and Solomyak [The dimension of graph directed attractors with overlaps on the line, with an application to a problem in fractal image recognition. {\it Fund. Math.}, {\bf 180}(3):279-292, 2003] and can be considered as the continuation of the works [On the dimension of self-affine sets and measures with overlaps. {\it Proc. Amer. Math. Soc.}, {\bf 144}(10):4427-4440, 2016], [On the dimension of triangular self-affine sets. {\it Erg. Th. \& Dynam. Sys.}, to appear.] by the authors. We also present some applications of our results for the generalized Takagi functions and fractal interpolation functions.