A non-transitory computer-readable storage medium storing computer-readable instructions therein, the computer-readable instructions configured to instruct a processor to execute a process comprising:
- storing image data corresponding to an image in a memory, the image data comprising a first density value for each pixel of a plurality of pixels arrayed in a matrix, wherein the first density value corresponds to a first recording mode;
- receiving information specifying a second recording mode that is different from the first recording mode;
- setting an image recording mode for recording the image on a recording medium to the second recording mode when the information specifying the second recording mode is received, wherein the image is to be recorded on the recording medium with a second set of image density values when the image recording mode is set to the second recording mode, wherein the image is to be recorded on the recording medium with a first set of image density values when the image recording mode is set to the first recording mode, and wherein each image density value of the second set of image density values is less than a corresponding image density value of the first set of image density values;
- converting the first density value for each pixel comprised in the image data to a second density value that is less than the first density value when the second recording mode is set as the image recording mode;
- setting an image boundary determination threshold to one of a first threshold value and a second threshold value, wherein the image boundary determination threshold is set to the first threshold value when the first recording mode is set as the image recording mode, wherein the image boundary determination threshold is set to the second threshold value when the second recording mode is set as the image recording mode, and wherein the second threshold value is less than the first threshold value;
- calculating a density gradient value for each pixel comprised in the image data based on one of the first density value for the each pixel and the second density value for the each pixel, wherein the density gradient value is calculated based on the first density value for the each pixel when the first recording mode is set as the image recording mode, wherein the density gradient value is calculated based on the second density value for the each pixel when the second recording mode is set as the image recording mode;
- and
- determining whether each pixel comprised in the image data corresponds to a boundary of the image based on the density gradient value for the each pixel and the image boundary determination threshold.