BenSande wrote:Mogrify doesn't have the ability to stream to a binary short storage file, which is what I really need. Neither does convert, otherwise I would be using that. The -map and -storage-type tools are stream only.
In your case, if I understand correctly,
Code: Select all
convert -depth 16 file.bmp GRAY:file.raw
will do the same thing. (mogrify has same ability so
Code: Select all
mogrify -depth 16 -format gray -- *.bmp
would work but it does not have the ability to change file name. So you get
filename.gray instead, and have to rename it later.
Recommended to read
http://www.imagemagick.org/Usage/basics/#mogrify_not)
BenSande wrote:I get one file titled *.raw, which seems to be the data from just the first file. I've tried a few variations on the asterisks, but got error messages, and am quite puzzled.
Expanding * is a work of shell, not a ImageMagick, so even
would not work as you expected. Suppose you have only .bmp files, say 1.bmp 2.bmp, in your current directory, Imagemagick received
"convert" "1.bmp" "2.bmp" "*.png"
You can check it using -debug 'Configure'
Code: Select all
$ convert -debug 'Configure' *.bmp *.png 2>&1| head
2015-07-29T11:22:45+09:00 0:00.009 0.015u 6.9.1 Configure convert[3464]: utility.c/ExpandFilenames/936/Configure
Command line: convert {-debug} {Configure} {1.bmp} {2.bmp} {*.png}
then *-0.png and *-1.png are created automagically (as PNG doesn't support multi page format.)
So '-set filename' trick may work for convert. Try
Code: Select all
convert *.bmp -depth 16 -set filename:f '%t' +adjoin GRAY:'%[filename:f].raw'
But still, I think for loop with stream is best answer as long as you use unix. It is easier to understand and there is no reason for loop is not suitable for batch.