It is no fault of brilliant gallery when rescaled images, especially small thumbnail images, look rather blurred compared to the original. Any graphics library or graphics program which use antialiasing when resampling images create more or less blurred small images. Which is why I normally add a light sharpening effect to improve the image quality when creating rescaled photos with my graphics program.
Brilliant gallery uses the GD library for rescaling images to thumbnails, but GD doesn't offer any sharpening effect function. Bad luck, if you don't have an alternative.
Recently I found out about an alternate graphics library called "Imagemagick" and the PHP extension "Imagick". The library contains a lot of useful graphical functions including sharpening effects. If you manage to have both installed with your web server (Imagemagick version 6.3.0 or above) you are lucky: you can use the patch in the attachments to patch the function "resizeimage" in the file image.php of the brilliant gallery module to use imagick functions instead of GD functions and have the thumbnails (and rescaled fullsize images) being sharpened after rescaling.
Compare the two thumbnail images in the attachments to see the difference.
Maybe future versions of brilliant gallery could offer an option to use either GD or Imagemagick and in case of the latter its improvements. Because imagemagick claims even to be faster than other graphics libraries it could even be used all over the module and not only in the resizeimage function I modified. As you also can see by comparing the original version of "image.php" and the patched version, the new version of "resizeimage" has a lot less lines of code. The only disadvantage is that this library is not fully documented yet (see php.net).
Maybe this helps somebody,
regards,
Christian.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | brilliant_gallery-5.x-4.4_imagick.patch | 2.3 KB | meichr |
| #1 | brilliant_gallery-5.x-3.1_imagick.patch | 2.77 KB | meichr |
| after_sharpening.jpeg | 3.59 KB | meichr | |
| before_sharpening.jpeg | 2.8 KB | meichr | |
| image.php_.patch | 2.51 KB | meichr |
Comments
Comment #1
meichr commentedThe patch ported to version 5.x-3.1 is in the attachments.
In addition to the sharpening of a thumbnail (or full) image to improve image quality of small (thumbnail)
images now also the compression for jpeg images has been increased to 95% to get very clean thumbnail
images without visible jpeg distortions.
Use this patch when your web package has Imagemagick 6.3.0 or higher and the php imagick extension
installed to vastly improve the quality of thumbnails generated by Brilliant Gallery.
Regards,
Christian.
Comment #2
meichr commentedHere comes the same patch for version 4.4 of brilliant gallery.
Comment #3
avpadernoI am closing this issue, as it has been created for a release that is now not supported.