This is a highly specific request for DOpus, let alone for any photo app but it sounds like you could use selective blurring instead, which very common these days.
Regardless, here's the batch file for it, you'll need ImageMagick. You could rewrite it as a DOpus script if you'd have the coordinates of the selected region in the viewer, but I am not familiar with if or how it is supported. Of course with few changes it could be used for blurring as well.
@echo off
setlocal
:: original image file
set original_image=your_image.jpg
:: convert original image to png before processing
set intermediate_image=intermediate_image.png
:: temp files to hold the high and low-quality segments
set high_quality_crop=high_quality_crop.png
set low_quality_bg=low_quality_bg.png
set final_image=final_output.jpg
:: convert original image to png
magick convert "%original_image%" "%intermediate_image%"
:: dimensions for the high-quality area (x, y, width, height)
:: these values should be adjusted based on the specific area you want to retain at high quality
set x=100
set y=100
set width=300
set height=200
:: step 1: crop the high-quality area from the png image
magick convert "%intermediate_image%" -crop "%width%x%height%+%x%+%y%" +repage "%high_quality_crop%"
:: step 2: create a low-quality version of the png image
magick convert "%intermediate_image%" -quality 5 "%low_quality_bg%"
:: step 3: overlay the high-quality crop onto the low-quality background
magick convert "%low_quality_bg%" "%high_quality_crop%" -geometry "+%x%+%y%" -composite "%final_image%"
:: cleanup temp files
del "%high_quality_crop%"
del "%low_quality_bg%"
del "%intermediate_image%"
echo Finished processing. The final image is '%final_image%'.
EDIT: Leo/Jon: Is it possible to add selbottom, selleft, selright, seltop to Viewer object analog to bottom, left.. which would return selection coordinates?