I want to convert all NEF/RAW image files to an image format that could be easily opened without additional tools.
I thought about using ImageMagick's convert
tool as mentioned in How can I convert a .jpg or .png image to .raw format?
However, I don't see any parameter for recursively looking for images in all subfolders nor for removal of old/original images in the documentation of the convert
tool.
Should I look for another tool, or the only option is to write some loop around convert
?
Imagemagick cannot convert raw image files in recent Ubuntu versions because the
ufraw-batch
package is not available, due to it not being maintained anymore. We can however usedarktable
to do the conversion. To installdarktable
run:You can then use this command that uses
darktable-cli
to convert the images:The above command uses
find
to do the following:.
-type f
.raw
or.nef
, irrespective of their case:\( -iname "*.raw" -o -iname "*.nef" \)
-exec
) this command to convert the found files to jpg:sh -c 'darktable-cli {} ${0%.*}.jpg' {} \;
-delete
Caution: Make sure to first test the command in a copied portion of your files to ensure that it works as intended!
The below command worked for converting Canon CR2 RAW into jpg with darkable ver. 4.0.0.
To just be able to view the files, you don't need to develop your raw image with
darktable
orufraw
, all common formats have an embedded preview image.You can extract the preview with e.g.
dcraw
:Or you can use a proper image viewer that will open the files and show the embdedded preview (e.g.
geeqie
).