{"id":20132,"date":"2012-10-01T08:55:28","date_gmt":"2012-10-01T08:55:28","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/grayscale\/"},"modified":"2013-10-28T15:01:08","modified_gmt":"2013-10-28T15:01:08","slug":"grayscale","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/grayscale\/","author":8308409,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.2","stable_tag":"1.2","tested":"3.7.41","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Grayscale","header_author":"Fabien Quatravaux","header_description":"","assets_banners_color":"fbc8c8","last_updated":"2013-10-28 15:01:08","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/www.1nterval.com","rating":0,"author_block_rating":0,"active_installs":100,"downloads":5755,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"608296","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[10380,133,163,1326],"plugin_category":[50],"plugin_contributors":[83325],"plugin_business_model":[],"class_list":["post-20132","plugin","type-plugin","status-closed","hentry","plugin_tags-grayscale","plugin_tags-image","plugin_tags-images","plugin_tags-thumbnail","plugin_category-media","plugin_contributors-fab1en","plugin_committers-fab1en"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/grayscale_fbc8c8.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Sometimes, your website design requires to turn pictures in black &amp; white : for example in a gallery display, you can have all thumbnails in grayscale and bring up colors when the mouse is hovering it.\nThis plugin will make it possible without the need to manualy create the grayscale variant of each picture.<\/p>\n\n<p>In your theme's <code>functions.php<\/code>, instead of using WP <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/add_image_size\">add_image_size<\/a> function, use <code>grayscale_add_image_size('custom_size', xxx, yyy, $crop, $grayscale)<\/code> (with <code>$crop<\/code> set to <code>true<\/code> if you want to crop the image, and <code>$grayscale<\/code> set to <code>true<\/code> if you want a grayscale version of the image). Then, you can use <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/the_post_thumbnail\">the_post_thumbnail<\/a> or any thumbnail function to get your grayscale image :<\/p>\n\n<pre><code>the_post_thumbnail('custom_size-gray')\n<\/code><\/pre>\n\n<p>A gamma correction is applied automatically to make the black &amp; white pictures look good. From version 1.2, You can tune this gamma correction with the <code>grayscale_gamma_correction<\/code> filter. Your filter would have to return a float number that will be use as the <code>outputgamma<\/code> parameter of the <a href=\"http:\/\/php.net\/manual\/fr\/function.imagegammacorrect.php\">imagegammacorrect<\/a> function.<\/p>\n\n<h4>Known bugs<\/h4>\n\n<ul>\n<li>Grayscale images are not generated when the original image size is smaller than the specified thumbnail size.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Upload the plugin files in your wp-content\/plugins directory and go to the Plugins menu to activate it.<\/p>\n\n<p>This plugin requires the GD php library bundled with PHP since version 4.0.6. You will be notified if your system does not support it, and you will be able to activate the plugin.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>Do I still have to use add_image_size if I want a colored version of my images ?<\/dt>\n<dd><p>No, a colored thumbnail at the specified size is already created. You can display it with <code>the_post_thumbnail('custom_size')<\/code> whereas the black and white one will use <code>the_post_thumbnail('custom_size-gray')<\/code>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial version<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Minor change in documentation<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Remove wp_load_image use (deprecated)<\/li>\n<li>Use a class that extends WP_Image_Editor_GD<\/li>\n<li>Add grayscale_gamma_correction filter to tune gamma correction<\/li>\n<\/ul>","raw_excerpt":"Automatically create grayscale thumbnails for a given image size.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/20132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=20132"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/fab1en"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=20132"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=20132"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=20132"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=20132"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=20132"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=20132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}