This is a global answer to people asking about the best export options in darktable to post to social media.
Some introduction
Social media remove pretty much all EXIF put into your pictures, including the ICC profile that you may have embedded there. They simply don’t care. Also, if your picture doesn’t fit the max resolution and max weight allowed by the platform, it will be harshly downsized with the very destructive algos of the platform. Again, they don’t care.
So the rule of thumbs is to not be zealous about image quality and serve them just what they ask. Besides, people will most likely look at your pictures out of boredom while taking a number 2, on a shiny screen full of finger grease and Escherichia coli. So… don’t spend too much time on that, it’s not worth it. Work for prints, work for your own website but don’t bother too much about quality for social platform.
Editing
If I was really naughty, I would say that editing for social media should be +100 of local contrast, +100 of global contrast, +100 of saturation and +100 of sharpness. It seems you can’t go wrong by cranking everything to the top if you are after those precious likes.
One important module to enable is the dithering. This will help preventing some “banding effect” when using JPEG compressions (mostly by making compression harder, hence increasing file size…). You can put that in a style to enable only when exporting to web JPEG. Just be aware that banding can still happen because you went too harsh on the JPEG compression, though.
Exporting
Color space
Export in sRGB, with perceptual intent.
If you export for the World Wide Web, outside of cheap platforms that will strip EXIF, you could technically export to whatever color space you want, provided the ICC profile is written in the file metadata, since nowadays pretty much all browsers have color management and can convert whatever color space to your display space. darktable always write the color profile in metadata. However, once the EXIF have been stripped away, as Instagram and Facebook will, the ICC standard says “assume it’s sRGB”. So, no profile means the file is interpreted as sRGB. Thus, encode it to sRGB at export for safety.
But, for your own website or for photographer-centric platforms, any color space would do as long as EXIF are kept.
Resolution / pixel count
Double-check that, because it changes all the time, but in 2021 it seems pretty much all platforms have converged toward a max size around 1080×1080 px. Remember, if you send larger files, the platform will shrink and melt them with destructive compression, so just send whatever they ask compressed in-house with reasonable algos, but nothing more.
File format
JPEG.
The tricky thing with JPEG is it tries to achieve high compression rate by crushing smooth gradients first. That’s why banding artifacts happen in smooth skies and blurry backgrounds first.
A quality factor of 85 usually gives a good trade-off between size and quality with unnoticeable quality destruction. If, even with dithering, you find your smooth zones to have banding, either increase the factor (to increase the quality) or try to add some noise/grain to trick the compression algo with high frequencies.
WebP would be so much better, and Facebook is supposed to support it, however the latest version of Apple Safari only has partial support for it since sept. 2020, and support for other platforms became ubiquitous since 2019 only. Also, in case a platform doesn’t support it, you probably don’t want to rely on FB to provide a JPEG fallback.
Metadata
You can try embedding copyright and title of the picture in the metadata, just in case they keep them, but anything else will be stripped away, so don’t bother. In any case, remove the GPS tags if any, so the GAFAM can’t get too much data on you.
File size/weight
Until 2018, it was said that the max weight for Facebook images was 100 kB if you wanted to avoid extra compression. Past that threshold, FB would apply another pass of ugly compression.
I have no idea if it is still up to date, but remember the EXIF/XMP can weigh more than 40 kB if you also include the development history. In any case, for a 1080×722 px image, you would need to go as low as 80-82 for the quality compression to match that threshold.
Remember that the compression ratio is contextual. Pictures with a lot of high frequencies (landscapes at f/8 and less, noisy/grainy pictures, etc.) will not be compressed as much as smooth pictures, even with the same compression quality factor.
It can therefore be worth a try to reduce the resolution in order to keep the compression minimal and preserve gradients, rather than having 2048×2048 px of pure banding artifacts at quality = 60.
However, you have no control over the resized/cropped thumbnails that the social media might serve.
Bonus : how to check what social media do to EXIF ?
You can try to upload a test picture to some social media with full EXIF, and then download the final file and analyze it with exiftool
. Here is an example from Instagram:
$ exiftool 135383691_845786625998420_1798965656672895089_n.jpg
ExifTool Version Number : 12.00
File Name : 135383691_845786625998420_1798965656672895089_n.jpg
Directory : .
File Size : 231 kB
File Modification Date/Time : 2021:02:03 03:15:43+01:00
File Access Date/Time : 2021:02:03 03:15:44+01:00
File Inode Change Date/Time : 2021:02:03 03:15:43+01:00
File Permissions : rw-rw-r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Current IPTC Digest : 1e43db3711d76ed95c3c5e43963c08bd
Special Instructions : FBMD2300096a010000574400002e6f0000ce850000a3730100aebc0100723e0200048c020066ce0200529c0300
Image Width : 1080
Image Height : 1080
Encoding Process : Progressive DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 1080x1080
Megapixels : 1.2
No copyright, no nothing. They own your pics.