I found out that outputting to a stdout and to a file will not always result in the same format. The last should be P3 (color) but is actually P2 (gray).
Code: Select all
convert rose: -depth 8 -set colorspace Gray -compress none -format pgm - | head -n 1 # P2
convert rose: -depth 8 -set colorspace RGB -compress none -format pgm - | head -n 1 # P3
convert rose: -depth 8 -set colorspace Gray -compress none -format pgm test.pgm ; head -n 1 test.pgm # P2
convert rose: -depth 8 -set colorspace RGB -compress none -format pgm test.pgm ; head -n 1 test.pgm # P2 -- why???
Code: Select all
convert rose: rose.tif
convert rose.tif -depth 8 -set colorspace RGB -compress none -format pgm - > test.dat
identify test.dat # test.dat TIFF 70x46 70x46+0+0 8-bit sRGB 9924B 0.000u 0:00.000
Thanks
ImageMagick 7.0.8-36 Q16 on gentoo linux