Neil Cassidy Posted November 10, 2009 Share Posted November 10, 2009 Update: Performance and stability fix, see post below for details! Hi everyone, Here's my second plug-in, "Average Color (HSL)". The original idea for this plugin is due to phrebh, who brought this up in the other thread. It's based on the observation that averaging the color of a selection might make more sense in a color space that better reflects human perception of color than sRGB does. I would have used CIELAB, but an average of valid sRGB colors in CIELAB space won't necessarily yield another valid sRGB color. The following examples demonstrate how this effect differs from a comparable plugin that averages the RGB values directly, Average Color of Selection. I ran each effect on twelve different blocks of each image. Image attribution: Candy, Landscape. The pixels on the left half of the test pattern are all fully saturated. Many thanks to the following people for helping to make this plugin possible: Rick Brewster, Tom Jackson, BoltBait, Sepcot, phrebh, and MJW. As usual, install by copying the .dll to your effects directory. License (MIT) is included in the archive. Enjoy! I'll be glad to release the source if anyone would like it, but the project is a little disorganized right now, so I'll have to clean it up first. Let me know... Version 1.0 was downloaded 369 times. AverageColorHSL.zip Quote Segment Image : Average Color (HSL) : Eigen Blur : []Cool, new forum! Link to comment Share on other sites More sharing options...
Frontcannon Posted November 10, 2009 Share Posted November 10, 2009 Respect, thank you very much Quote Night Vision Text Effect Tutorial Gallery reddit.com/r/futurebeats | My Mixcloud Link to comment Share on other sites More sharing options...
Neil Cassidy Posted February 6, 2010 Author Share Posted February 6, 2010 Updated. A really bad memory leak has been fixed! See first post for download. I was preallocating a large arraylist to avoid dynamic expansion and associated heap fragmentation, but instead of doing this only once, I was doing it for every region of interest. So I was using the effect on some large non-contiguous selections this morning, obtained by using Segment Image and Magic Wand, and got some out-of-memory errors. I fixed it up immediately and did a little refactoring. It shouldn't run out of virtual memory anymore, and performance is greatly improved (although still not optimal). Other changes: - Effect has been moved to the "Color" sub-menu. - Analysis stage has been moved to OnSetRenderInfo method. The double-checked lock + memory barrier hack isn't necessary unless the effect is built in Code Lab. - Instead of scanning over the selection's bounding box and using the IsVisible test to determine whether a given pixel within the box is actually selected, it now scans over the regions of interest directly, which also improves performance. Quote Segment Image : Average Color (HSL) : Eigen Blur : []Cool, new forum! Link to comment Share on other sites More sharing options...
phrebh Posted December 28, 2022 Share Posted December 28, 2022 Not to bring up a dead topic, but 12 years later and search results have brought me back here. I'm glad to see you ran with this and made it so much better than I could have. Quote Do not click the picture above. It will take you to my site, and I don't need the anxiety. Link to comment Share on other sites More sharing options...
MXI Posted January 12 Share Posted January 12 S/L gradient (of HSL) in the test pattern actually looks like S/V gradient (of HSV). Triggered. I'd expect S/L gradient to look like this: Quote My content: custom shapes FRs: selections lists stored within pdn file | HSL and/or pluggable Colors box Link to comment Share on other sites More sharing options...
Reptillian Posted January 16 Share Posted January 16 On 1/11/2023 at 8:27 PM, MXI said: S/L gradient (of HSL) in the test pattern actually looks like S/V gradient (of HSV). Triggered. I'd expect S/L gradient to look like this: Then, you can code something like this yourself. It's not that hard for a intermediate coder. Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
MXI Posted January 17 Share Posted January 17 3 hours ago, Reptillian said: Then, you can code something like this yourself. It's not that hard for a intermediate coder. I'm just pointing at an inconsistency. If this mistake slipped into the post and test images - chances are, the plugin itself might be doing not what it says it does. Quote My content: custom shapes FRs: selections lists stored within pdn file | HSL and/or pluggable Colors box Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.