I tested on Linux, my development OS. The simple test
cat foo.pgm | gmic -.pgm
is working. The second test with potrace output is not. gmic assumes the stream is a 3D file while in fact it is a P5, 2D pgm, file. See header below produced by potrace (ill formed?) and gmic output. Maybe P5 should be sufficient to indicate this is a 2D PGM? In fact, when saved to a file containing the same header format below gmic reads it with no problem:
- problematic:
cat foo.pgm | potrace -g | gmic -.pgm
- okay:
cat foo.pgm | potrace -g -o nada.pgm; gmic nada.pgm
The test below works, after splitting image size and quantization into different lines, so I assume gmic doesn’t like the formatted stream as is:
cat foo.pgm | potrace -g | awk '{ if (NR==3) { print $1,$2,"\n",$3 } else print $0 }' | gmic -.pgm
I will be happy to do other tests if needed, let me know.
P5
# created by potrace 1.16, written by Peter Selinger 2001-2019
1500 1500 255
_���"���"��.���=ԝ�…
[774] : cat ct.pgm | potrace -g | gmic -i -.pgm
[gmic]./ Start G’MIC interpreter (v.4.0.5).
[gmic]./ Input file ‘-.pgm’ at position 0 (1 image 1500x1500x255x1).
[gmic]./ Display image [0] = ‘-.pgm’.
[0] = ‘-.pgm’:
size = (1500,1500,255,1) [2188.7 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,