image processing - ImageMagick convert from GRAY to TIFF using stdin -
i have file i'm saving in raw gray format, gets converted tiff. running command follows works:
convert -size 1024x1024 -depth 16 -endian msb imgtemp.gray /tmp/bla.tiff but changing use stdin input doesn't:
cat imgtemp.gray | convert -size 1024x1024 -depth 16 -endian msb -:gray /tmp/bla.tiff i following error:
convert: no decode delegate image format gray' @ error/constitute.c/readimage/532. convert: missing image filename/tmp/bla.tiff' @ error/convert.c/convertimagecommand/3011.
the question why?
you have stdin , format flipped. "-:gray" should "gray:-"
cat imagetemp.gray | convert -size 1024x1024 \ -depth 14 \ -endian msb gray:- /tmp/bla.tiff to answer why happening. can run previous command -verbose switch.
cat imgtemp.gray | \ convert -verbose \ -size 1024x1024 \ -depth 16 \ -endian msb -:gray /tmp/bla.tiff this give use additional line of information explains imagemagick trying do
convert: unable open image `gray': no such file or directory @ error/blob.c/openblob/2638. convert: no decode delegate image format `gray' @ error/constitute.c/readimage/550. convert: no images defined `bla.tiff' @ error/convert.c/convertimagecommand/3078. convert command becomes confused -:gray , tries open blob file entitled "gray", , attempts open "bla.tiff" source image. both of them non-existing on filesystem.
Comments
Post a Comment