>
Download This Plugin | |
Download Elegant Themes | |
Name | Grayscale |
Version | 1.2 |
Author | Fabien Quatravaux |
Rating | 0 |
Last updated | 2013-10-28 03:01:00 |
Downloads |
2670
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Grayscale plugin added 3 bytes of resources to the Home page and 7 bytes of resources to the sample Post page.
Grayscale plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Grayscale plugin ads no tables to your Wordpress blog database.Sometimes, your website design requires to turn pictures in black & white : for example in a gallery display, you can have all thumbnails in grayscale and bring up colors when the mouse is hovering it. This plugin will make it possible without the need to manualy create the grayscale variant of each picture.
In your theme's functions.php
, instead of using WP add_image_size function, use grayscale_add_image_size('custom_size', xxx, yyy, $crop, $grayscale)
(with $crop
set to true
if you want to crop the image, and $grayscale
set to true
if you want a grayscale version of the image). Then, you can use the_post_thumbnail or any thumbnail function to get your grayscale image :
the_post_thumbnail('custom_size-gray')
A gamma correction is applied automatically to make the black & white pictures look good. From version 1.2, You can tune this gamma correction with the grayscale_gamma_correction
filter. Your filter would have to return a float number that will be use as the outputgamma
parameter of the imagegammacorrect function.