Use bisection method for finding the best image compression
At https://code.briarproject.org/briar/briar-desktop/-/blob/main/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/attachment/media/ImageCompressorImpl.kt#L66 the best image size is found by
for (quality in 100 downTo 1 step 10) {
How about replacing the for loop with a loop using the bisection method.