As an update, I tried running the command on a 4k x 4k file and terminated it after 25 hours.
I just ran the command on a 3.2k x 3.2k image with debug on and piped the output to file. The process completed in about 1 minute and produced a log file of 517k bytes.
I followed up by running the command on a 3.6k x 3.6k image. The program has now been running for 14 minutes and the size of the log file is up to just over 4 Mb. It seems that the amount of processing has exploded for images at some point between a 3.2x3.2 k image and a 3.6x3.6 k image.
Update: Killed the 3.6x3.6k test after 1 hour of run time. Following are the last several lines of the log file.
<gmic>-3./fx_cpencil/*repeat/*local/*local/quantize/*repeat/*local/*if/colormap/*repeat/*local/*if/*if/*do/ Item 'if', selections [0,1,2].
<gmic>-3./fx_cpencil/*repeat/*local/*local/quantize/*repeat/*local/*if/colormap/*repeat/*local/*if/*if/*do/ Command 'if': arguments = '$is_half' -> '0'.
[gmic]-3./fx_cpencil/*repeat/*local/(...)/*if/*if/*do/*if/ Start 'if...endif' block -> condition '0' does not hold.
<gmic>-3./fx_cpencil/*repeat/*local/*local/quantize/*repeat/*local/*if/colormap/*repeat/*local/*if/*if/*do/*if/ Item '..,1,1,{1,s+1}' -> '..,1,1,4', selection [].
<gmic>-3./fx_cpencil/*repeat/*local/*local/quantize/*repeat/*local/*if/colormap/*repeat/*local/*if/*if/*do/*if/ Command 'input': arguments = '..,1,1,4' -> '[-2],1,1,4'.
[gmic]-3./fx_cpencil/*repeat/*local/(...)/*if/*if/*do/*if/ Input black image at position 3 (1 image 20x1x1x4).
<gmic>-4./fx_cpencil/*repeat/*local/*local/quantize/*repeat/*local/*if/colormap/*repeat/*local/*if/*if/*do/*if/ Item 'f..', selection [2].
<gmic>-4./fx_cpencil/*repeat/*local/*local/quantize/*repeat/*local/*if/colormap/*repeat/*local/*if/*if/*do/*if/ Command 'fill': arguments = '>I[#3\,i]+=[ I[#0\,x]\,1 ]'.
[gmic]-4./fx_cpencil/*repeat/*local/(...)/*if/*if/*do/*if/ Fill image [2] with expression '>I[#3,i]+=[ I[#0,x],1 ]'.
Unfortunately I don’t have the time just now to pursue this further - and am not sure when I’ll be able to return to it.
Thanks everyone for your feedback. Jim