WPTemplate.com

Steps for Grayscaling Images on WordPress

In early 2000’s, WordPress users have wondered to find out the way in which they could automatically gray scale the images whenever they insert the images into website.

This tutorial presents you the procedure for the automatic gray scaling the images by utilizing some simple and striking PHP image editing tools and making changes to some WordPress functions. The gray scale image that you create can be best used for your hovers, gallery and sliders etc.

The process of gray scaling images first requires you to access the theme’s functions.php file and insert the below highlighted code into it.

Grayscaling Images on WordPress

The code that you have pasted will quickly enhance the image size supported by the media uploader. The size of every image that you place must be cropped to 100 x 100px. And further you can even alter the dimensions such that the images meet your requirements. Once done with the image configuring, you must add the below given code into functions.php file.

Grayscaling Images on WordPress

The code pasted above will automatically hint the media uploader to increase the size of image that you have uploaded. Adjust the settings such that the image size will automatically scale down to 100 x 100px and then you must apply the Grayscale filter to transfer the image.

In case, if you wish to use the gray scale image for your featured image, you can do it by placing the underneath code in WordPress coding.

Grayscaling Images on WordPress

And if you wish to gray scale the image for certain attachment, you can utilize the wp-get-attachment-image function.

Turning the Images into Gray Scale Via the Gray Scale Plugin:

At times, you plan to convert few images into black & white and give a colour effect to the images, whenever you hover the mouse on the image. With this Gray Scale plugin, you need not give the gray scale variant to every image that you have in your gallery.

Grayscaling Images on WordPress

To add this plugin to your website, you must first download the plugin and upload all the relevant plugin files into your wp-content/plugins directory. Then you must reach the Plugins menu to activate it.

This plugin requires you to have the GD PHP library as the plugin is packed with PHP from its latest version 4.0.6. You get notified by your system for not supporting it.

Note: The gray scale images that you are planning to generate can’t be created if the image size is less than intended thumbnail size.

Leave a Reply

Your email address will not be published. Required fields are marked *

ten + seventeen =

Time limit is exhausted. Please reload the CAPTCHA.

1000's of Wordpress Templates at Great Prices: Visit ThemeForest