No-reference image quality assessment based on localized gradient statistics: application to JPEG and JPEG2000