Hello, i am using this software free and there you can see open source code ( https://github.com/ilyakurdyukov/jpeg-quantsmooth) for JPEG artifacts removal.
And you can seecommands on this page (https://github.com/ImageProcessing-ElectronicPublications/libjpegqs)
Also Web version available here (https://ilyakurdyukov.github.io/jpeg-quantsmooth/)
I have a request from you, may can someone do for plug-in for in Paint.Net or like RIOT.
Best Regards