Why am I losing image quality on my site?

You have not explained what kind of code changes you did in functions.php but the code you should put in your functions.php is

function jpeg_quality_controller( $quality, $context ) {
    return 100;
}
add_filter( 'jpeg_quality', 'jpeg_quality_controller', 10, 2 );

But this solution will not make any changes to already uploaded image files. Delete already uploaded images and try to re-upload them.

If you already did the above and still find your uploaded images are not as sharp as original, then it may have something to do with WordPress auto resizing. By default, WordPress resize your uploaded images in three different sizes Large, Medium and Thumbnail size. You can stop making these image resizing by adding the following code in your functions.php

add_action('init', 'remove_default_image_sizes');

function remove_default_image_sizes() {
    remove_image_size('thumbnail');
    remove_image_size('medium');
    remove_image_size('medium_large');
    remove_image_size('large');
}

Now you are left with only the original size of images you upload.

Again remember this solution will not make any changes to already uploaded image files. Delete already uploaded images and try to re-upload them.