How to process RAW images with the command line in Linux

camera-rawcommand lineimages

I want to be able to manipulate RAW images from the Linux command line, like so:

cat raw1.img | raw2jpg -w 640 -h 480 -pitch 1024 -pixelformat R8G8B8

tr='transpose -pitch 1024 -depth 24'
cat <(cat raw1.img | $tr) <(cat raw2.img | $tr) | transpose -pitch 480 >x-merge.img

cat gamebitmap.dat | (
    raw2png -w $w -h $h -depth 24 -pixelformat R8G8B8
) | png2svg -extractoutline -fuzzy -error 8 -smooth

Obviously I've made up the raw2png, raw2jpg and transpose programs.

Does ImageMagick support operations like this with camera RAW files? If not, is there any other way I can manipulate these images from the command line?

Best Answer

Which type of raw file?

There's Sony, Kodak, Nikon, Olympus, etc. Full list

Have you tried convert from ImageMagick, e.g.

convert raw1.img raw1.jpg

What does

file raw1.img


What happens if you rename raw1.img to one of the extensions listed in the link, e.g. raw1.arw or raw1.crw?