I want to know if its possible (and how) to check for real image quality (.jpg) using the GD library.
Obviously we need to check for file size, colors, image size, and number of pixels and compare between them.
For example if an开发者_如何学编程 1200x600px image has a size of 60kb probably its in bad quality. But if the image is in grey scale, or uses only some colors, then maybe its in good quality...
So... any ideas?
What you want is a no-reference image quality assessment. I don't know of a specific implementation for PHP but you can take a look in IEEE Transactions on Image Processing for algorithms.
There's an implementation with focus on JPEG compression here:
http://www.cns.nyu.edu/~zwang/files/research/nr_jpeg_quality/index.html
精彩评论