The geomechanical behavior of rocks is controlled mainly by their mineral content and texture. For this reason, determining the mineral content of rocks is highly important for their genetic classification and understanding their geomechanical behavior. Conventionally, the mineral content of rocks has been determined by point counting on thin sections. However, this process is exhaustive and time-consuming. This study presents a computer program, TSecSoft, that determines the mineral content of rocks. TSecSoft is developed with MATLAB10a, and the MATLAB scripts (m-files) are converted to a standalone application using MATLAB Deployment Toolbox. After automatically obtaining an initial segmentation, the user can correct segments to produce perfect segmentation. When correcting segments, the user can merge segments or divide one segment into several using the TSecSoft pen function. To assess the TSecSoft's performance, point counting and TSecSoft are used on six different thin sections prepared from granitic rock specimens, and their results are compared. The correlation coefficients of the mineral percentage values obtained from point counting and TSecSoft are considerably high. All results indicate that a useful and time-saving tool has been produced for determining the mineral percentages of rocks. (C) 2012 Elsevier Ltd. All rights reserved.