A computational algorithm capable of generating 2D elemental maps in mu-PIXE analysis of inhomogeneous thick targets has been developed and implemented in a program written in C language. The program allows users to define 3D inhomogeneous thick targets in terms of slices and inclusions. The use of this program to generate 2D elemental maps and line scan intensity distributions for several simple targets is demonstrated. One of the targets is a glass block with a thin dip on its surface. The line scan intensity distribution generated agrees reasonably well with that obtained from an experiment.