I have a bunch of avif-files that I want to convert to dng - as the software I want to use to work on the images does not accept avif - and I don't want to use jpeg. Any ideas? Thanks!
Asked
Active
Viewed 369 times
3
-
1You can try ffmpeg: https://ffmpeg.org/ffmpeg.html – kyodake Jan 16 '24 at 12:22
1 Answers
6
In Lubuntu Noble (a live session of the developing version) I tested imagemagick convert
and it complains
$ convert ttt.avif ttt.dng
convert-im6.q16: no encode delegate for this image format `DNG' @ warning/constitute.c/WriteImage/1310.
but the result, the dng file can be viewed by darktable
.
After that I created a dng file in Ubuntu 22.04.3 LTS, and that file can be viewed by darktable
too. So convert
can do it.
Install convert
by
sudo apt update
sudo apt install imagemagick
Convert all .avif files in a directory from avif to dng:
for image in *.avif ; do convert "$image" "${image%.*}.dng" 2>&1 | grep -v 'no encode delegate' ; done
Edit: darktable 4.4.2
in Ubuntu family version 23.10, the newest released version, can show dng files. This is an improvement from version 22.04.3 LTS.

sudodus
- 46,324
- 5
- 88
- 152
-
2If that works, then
mogrify -format dng *.avif
should work (no loop needed) I think …mogrify
comes with ImageMagick too. – Raffa Jan 16 '24 at 17:03 -
dng-Files are created - but apparently they are corrupt in some way. Could not open - tried gimp, gwenview, AfterShot ... – sers Jan 16 '24 at 21:38
-
@sers, My
gimp
cannot manage dng files, but mydarktable
could manage the files created viaconvert
. Please let us know if you can [install and] usedarktable
to view the dng files. And I suggest that you also check if the tool you want to use can manage dng files, that are created in some other way, for example directly from raw format pictures with some tool that you rely on. – sudodus Jan 17 '24 at 10:19 -
@Raffa, You prefer mogrify and I prefer convert :-P (An important reason for me to prefer convert is that it creates new files, does not overwrite the original files, which makes it 'more foolproof'). – sudodus Jan 17 '24 at 10:33
-
1It does overwrite the original except when
-format
is set and passed an extension likedng
... I know it's unexpected formogrify
, but that's a special case and I'm sure it's documented somewhere (as I remember this particularity) but I can't seem to remember where :-) – Raffa Jan 17 '24 at 12:14 -
1Found it https://imagemagick.org/script/mogrify.php (first paragraph) ... However the extension must change for this to not overwrite the original i.e. keeping the same extension like
mogrify -format png img.png
is not what that is. – Raffa Jan 17 '24 at 12:29 -
@sudodus interestingly my darktable cannot convert these dng-files ... just tried it - it just displays skulls ... – sers Jan 18 '24 at 06:43
-
@sers, You get different results compared to me. (By the way, my android phone can also show the dng files created by convert.) -- Which version of Ubuntu are you running (22.04.3 LTS or some other version)? Which version of imagemagick have you installed and which version of darktable have you installed? – sudodus Jan 18 '24 at 10:01
-
Furthermore, are you sure that your avif files are good (according to the specifications for avif files)? – sudodus Jan 18 '24 at 11:18
-
@sudodus sorry, I meant darktable cannot display these files - not convert. Imagemagick is an older version - it's from 2021: 6.9.11-60. Ubuntu is on 22.04.3 LTS. Darktable is on 3.8.1. And I can view the avif files all right with gwenview vor instance. – sers Jan 18 '24 at 13:39
-
1@sers, I knew since before that darktable in Lubuntu Noble works, but now I also tested the newest released version, Lubuntu 23.10, and darktable can show dng files there too. So a solution for you might be to run Ubuntu version 23.10 (or a community flavour like me, for example Lubuntu 23.10), where
sudo apt install darktable
will install version 4.4.2. This might also solve the problem with other software and dng files for you. – sudodus Jan 18 '24 at 15:33 -
1