I have a set of 1800 images (16Mb each, of the .img type).
I would like to convert them into a gif from the command line as I am remotely connected to the server they are stored on and it is not feasible to download all of them (for use with local programs). I cannot install new programs on the server, but it has imagemagick installed (IM).
When I try the standard command:
convert -resize 20% -delay 5 -loop 0 /pwd/*.img output.gif
no decode delegate for this image format IMG @ error/constitute.c/ReadImage/504.
convert: no images defined d263g_07.gif @ error/convert.c/ConvertImageCommand/3257.
As a first attempt, I think you will need something along these lines:
#!/bin/bash for f in *img; do cat "$f" | convert -depth 16 -size 2952x2820+3072 gray:- -resize 800x -normalize -depth 8 MIFF:- done | convert - -delay 80 result.gif
You may need to decrease the quality, or sub-sample frames or further reduce the size to get an acceptable GIF size. To decrease the size, change it to
-resize 500x maybe. Or to reduce the quality (and therefore the size), add in
-quality 75% or similar. See how you get on and report back!
So, save the above in a file called
go in your HOME (login) directory, then execute the following command (just once) to make it executable:
chmod +x $HOME/go
Then, go to the directory where the images are stored, e.g.:
and run the script by typing:
After a while it will hopefully finish and the animated GIF will be called
result.gif. If you still have problems, copy each line below as is and then paste them, one line at a time into your Terminal:
for f in *img; do cat "$f" | convert -depth 16 -size 2952x2820+3072 gray:- -resize 800x -normalize -depth 8 MIFF:- done | convert - -delay 80 result.gif
I don't know what viewers you have installed, but you could try:
I think we may have to do this answer stepwise... does this look like your image:
I got it like this:
convert -depth 16 -size 2952x2820+3072 gray:- -normalize a.jpg < ~/Desktop/d263g-07_1_0001.img