I am working on a project where I need to disable specific images from Google indexing, or disable based on their size. I do not have any idea other than adding this code in robots.txt:User-agent: Googlebot-ImageDisallow: /As my platform is WordPress, all the images are in Upload folder. So I can't disable based on the folder either. 
Disable indexing of specific Images or based on size
seo;wordpress;images;indexing;noindex
What you can do is generate your images in a programming language with headers to stop indexing and then use some rewriterules to reference that image.For example. Put this in your .htaccess:RewriteRule ^(.*)\.jpeg$ /background.php?FILE=$1 [L]Then create the file background.php with this template:<?php$jpeg=imagecreatefromjpeg('/server-path/to/imagefolder/'.$_GET['FILE'].'.jpeg');imagejpeg($jpeg,NULL,100);imagedestroy($jpeg);header('X-Robots-Tag: noindex, noimageindex',true);header('Content-type: image/jpeg',true);     exit();?>Put .htaccess and background.php in document root folder. Now when you make a request to anything ending in .jpeg from your document root, it will try to find the jpeg file in the /server-path/to/imagefolder folder and then the program adds an extra header to direct search engines not to index that specific file. If you want something super easy, then divide your images into separate folders and indicate the folder that is not to be indexed in robots.txt.