Love the live tinkering that this writeup gives you: https://parametric.press/issue-01/unraveling-the-jpeg/

Not so much a HOW to edit JPEG’s, but more an explanation of WHY things happen when editing/viewing.