No-Reference Image Quality Assessment Based on Localized Gradient Statistics: Application to JPEG and JPEG2000