From darktable to social media

I hacked together a simple bash script that runs a for loop based on imagemagik for each full size jpg in a temp folder.
Basically it runs (all values up to personal liking)

convert -resize 1000x1000 -define jpeg:extent=248KB -unsharp 0.4x0.6 infile outfile

The sweet thing is the -define jpeg:extent which causes convert to approach the demanded max file size in an iterative way by increasing the quality of the compression bit by bit. If the outfile size gets larger than the required max size, the last fitting value is taken.

Other things to play around with are -border and -bordercolor as some sites have these black backgrounds and I like to have the white frame around the picture (thank you for the color assessment mode in dt)