Posted: April 26th, 2010
About HLVGHasta La Vista, Green
from now on) is my first attempt at writing a Photoshop plug-in. Although I don't use Photoshop much for processing my images, I've always been curious about the procedure of writing a Photoshop plug-in. The HLVG filter seemed a good way to start since it's a very simple plug-in.
HLVG is a chromatic noise reduction tool that attempts to remove green noise and the green casts such noise may cause in some images. It is based on PixInsight's SCNR Average Neutral algorithm.
The idea is not new. We all know that with a very few exceptions (some planetary nebulae, comets, etc), there are no green objects in the sky. Therefore, if we've already correctly calibrated and color-balanced an image and it's free of gradients (to the best of our ability at least), we have to assume that if something else looks green in our images it's got to be noise...Don't mistake gradients with noise. Removing gradients are best dealt by subtracting a good background model. Chromatic noise on the other hand is tricky, since it "overwrites" the real data we want.
There are several techniques widely used to deal with this problem, however most of them rely on selections and adjustments that sometimes are not easy to execute. SCNR (the base algorithm used by this plug-in) is in my opinion one of the most reliable methods to deal with "green noise" and it works the same every time, without having to worry about anything, just click OK and you're done.
The only process applied between the BEFORE and AFTER images below is the HLVG plugin with the Strong
option selected, over a "color blended" layer.
The following three examples are somewhat "extreme", and in fact a couple of them do include uncorrected gradients, that HLVG obviously does NOT correct (see section above), but hopefully they serve the purpose of showing the effect of applying HLVG over a "green polluted" image.
To use HLVG you need a computer running Windows (tested on XP, Vista and Windows 7, both 32 and 64 bits) and Photoshop (tested on Photoshop 7, CS2, CS3, CS4 and CS5). HLVG will likely work under previous versions of Windows and Photoshop, and likely newer ones, but I haven't tested it. If you successfully run HLVG in any of the not-tested versions of Windows and/or Photoshop, let me know
Why not Mac? ... Short answer: because I don't have one, therefore I cannot compile and test the plug-in for the Mac.
Downloading HLVG is easy, simply click one the links below:
For any non-64 bits version of Photoshop : DOWNLOAD HLVG
For Photoshop 64 bits ONLY: DOWNLOAD HLVG 64bits
By the way, HLVG is free (as in "free beer") and I want it to stay that way, so permission is NOT given to include this plug-in in any commercial package. If you downloaded HLVG, whether standalone or as a part of a package, and paid for it, please let me know. Having said that, if you find HLVG useful and would like to make a small donation, please use the "Donate" button below. The Donate button will take you toPayPal - don't worry when you see the donation goes to AR Networks. Yes, that's me.
Once downloaded, you'll need to unzip
the HLVG.zip. This will extract the HLVG.8bf file.
Once extracted, copy the HLVG.8bf file to the Plug-Ins directory in your Photoshop installation.This usually is something like C:\Program Files\Adobe\Adobe Photoshop CS2\Plug-Ins but it may be different depending on the operating system and the Photoshop version you're running.
After you've copied the file to the Plug-Ins directory, start (or restart) Photoshop.
When you're ready to use HLVG (you'll need at least one image loaded in Photoshop, preferably an image already color balanced, and with any gradients already corrected), go to the Filters
menu, find the DeepSkyColors
menu option, select it, then click on the HLVG
sub-menu option. If you don't see it there, chances are you did something wrong when you copied the HLVG.8bf file, so double-check you indeed copied it to the right directory. Again, don't forget to restart Photoshop anytime you copy a plug-in filter to the Plug-Ins directory so Photoshop knows it's there.
Strong, or Weak, depending on whether you want HLV go ly hard on getting rid of treen noise, t moderately or simply slightly. The recommended setting i>Strong.
A note about lightnessHLVG may affect the lightness of the image a bit (the L component of the image if converted to CIELab). This is because the current version of HLVG does not save the lightness prior to applying its "degreening" algorithm (it might in a future version).
In order to preserve the exact lightness as the original image, it is recommended to follow this process:
- Duplicate the layer where you'd like to apply HLVG.
- Make the blending mode of that new copy to "Color".
- Apply HLVG over that new layer.
- Merge that new layer back with the original
The above process will get rid of unwanted green noise and hues without affecting the lightness at all. HLVG doesn't degrade the lightness considerably, so using it directly doesn't do a bad job, although I do recommend following the method I just described.
Bit depthHLVG should work on images of either 8, 16 or 32 bit depth. If you find that HLVG didn't work with your image, again, let me know.
Color ModeHLVG only works well when the image is in RGB mode. You can still use HLVG when you're in Lab or CMYK modes for example - HLVG won't complain - but the results will not be what you were expecting. Although this is something HLVG should take care of internally - say converting the image to RGB mode internally, then back to whichever mode it was before - at this point HLVG does not check the current color mode being used, and it simply assumes the image is in RGB mode, so you must make sure your image is in RGB mode prior to using HLVG.
HLVG and masksIf you preselect an area in your image - either with the lasso tool, select range, etc. - and then run HLVG, you may be in for a disappointment when you notice that HLVG completely ignored your mask and applied the effect to the entire image. Although I believe that HLVG works best when we leave it up to the plug-in to decide what areas require "HLVG'ing" and which don't, I can understand this behavior of ignoring a mask may feel odd to some people.While there's a chance I may "fix" this in a future version, if you must apply HLVG to just a specific area of your image, you can still do it by creating a duplicate layer, applying HLVG, inverting the mask and hitting the Delete key to get rid of the area you didn't want to "degreen". I don't recommend it, but if you must, that workaround should do the job.
:: 16 Comments
Nor (Contact, Page)
, August 22nd, 2010, 14:30
I just tried HLVG on PS6 and I get an error " Could not compete the HLVG command bevause of a problem with the filter module interface"
I know one can get that error if the image is grayscale, although I would expect you tried to run it over a color image (running HLVG on a grayscale image wouldn't do anything useful). I guess there might be other cases that would generate that error but I can't think of any right now. If you could post some information about your image (mode, size, etc) that might help track it down.
Nor (Contact, Page)
, August 25th, 2010, 16:41
I just ran the HLVG filter again but this time on a JPG image and it worked fine. Previously I tried to run it on a Photoshop file (PS6) and that is when I got the error.
Bill Snyder (Contact, Page)
, September 30th, 2010, 20:31
Just tried the HLVG plugin It works Great!!
Glad it works for you, Bill.
Thanks for the feedback and enjoy it!
domenicus (Contact, Page), October 20th, 2010, 6:06
Does this plug_in work also in Photoshop Elements?
Hello Domenicus. I haven't tried the plug-in in PS Elements. You're welcome to try and install it and let me know if it works. If other PS plug-ins are known to work with Elements, there's a chance HLVG will work too, but honestly I have no idea.
Gianfranco (Contact, Page), December 5th, 2010, 14:40
I also experienced the error" Could not complete the HLVG command bevause of a problem with the filter module interface". The error don't happens if i apply the hlvg filter withoutyour procedure.
Thank you for answer
Doug (Contact, Page), January 27th, 2011, 2:29
FYI Rogelio, the plugin works fine on CS5. Useful bit of kit - great work! :)
Greg Parker (Contact, Page)
, August 18th, 2011, 8:57
Hi Rogelio, I can confirm it runs fine on Windows 7 64-bit with CS3.
Dave (Contact, Page)
, September 26th, 2011, 12:51
I can confirm that your filter works fine with Photoshop CS5 64 bit version running on Windows 7 Home Premium (also 64 bit).
Mike Sherick (Contact, Page)
, September 28th, 2011, 12:33
This filter is exactly what I have been looking for! Works great in PS CS4 64bit.
Dave (Contact, Page), October 13th, 2011, 11:52
This works fine with elements 9
Nadeem Shah (Contact, Page)
, September 27th, 2012, 0:38
Your HLVG plugin works well with Corel Paint Shop Pro X4 & X5 Versions.
Thanks for the Plugin. Cheers.
daniel (Contact, Page), September 28th, 2012, 2:26
hi i cant get it to work with cs3 i have download both versions and moved the file into plugins but nothing in the filter menu in cs3
Moonstruck (Contact, Page), October 21st, 2012, 1:08
it does not work with Paint.NET v3.5.10 (Final Release Build 3.510.4297.28964)
but thx :)
Steve Mohr (Contact, Page)
, January 24th, 2013, 13:04
What a wonderful plugin you've generously shared. It works so easily and extremely effectively.
Thank you kindly,
Rob Courtier (Contact, Page), April 8th, 2013, 21:37
Downloaded, installed, have PS2, said it installed.
Can't find it.
Post a comment