MJW Posted June 22, 2017 Share Posted June 22, 2017 This plugin is admittedly quite similar to TR's Custom Palette Matcher, but may be useful. It's in the Color menu. The Plugin: Recolor Using Palette.zip As the Help menu says: Recolor Using Palette replaces each pixel color with the nearest color from a specified range of the current palette. The Euclidean distance is used. This minimizes the sum of the squared differences of the red, green, and blue color components. The controls are:Starting Palette Index: The number of the first palette color to use. Palette colors are numbered from 1 to 96. Ending Palette Index: The number of the last palette color to use. Ignore Opacity When Comparing Colors: When this option is enabled, only the red, green, and blue color components are compared; the alpha value is ignored. The original alpha is preserved in the replaced color. When this option is disabled, the image and palette colors are adjusted to account for their alpha values before being compared. The distance between colors is the distance between the colors when blended with the background color that maximizes the distance. The original alpha is replaced by the alpha of the nearest palette color. Show Original Image: When enabled, the original, unmodified image is displayed. The UI: Instead of managing palettes like TR's effect, it relies on PDN's built-in palette handling, which I think is fairly easy to use. Recolor Using Palette allows a subrange of the current palette to be used. (Note the color-entry numbering is one-based, not zero-based.) One interesting (which is not necessarily the same as useful) feature is that it can take opacity into account when doing the comparison. When opacity is used in the comparison, the entire palette color, including alpha, replaces the image color; otherwise, the image alpha is preserved, and only the red, green, and blue are replaced. Here's a demonstration, using the default palette. Original image: With Ignore Opacity When Comparing Colors enabled: With Ignore Opacity When Comparing Colors disabled: (To be useful in this mode, the palette would likely need to be better suited to the image than it is in this case.) Ignore Opacity When Comparing Colors is disabled by default. 6 Quote Link to comment Share on other sites More sharing options...
Red ochre Posted June 22, 2017 Share Posted June 22, 2017 Thanks! Only had a quick try so far but looks good. Useful to be able to select only part of the current palette to use. Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Seerose Posted June 22, 2017 Share Posted June 22, 2017 @MJW! Thank you so much. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
lynxster4 Posted June 22, 2017 Share Posted June 22, 2017 Thank you, @MJW! I'm sure this will be useful...I'll try it out! Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
David Feng Posted July 28, 2021 Share Posted July 28, 2021 Sorry to dig up this post 4 year later. I know this plugin uses the euclidean distance between two pairs of RGB component. Though I've recently read about a better-tuned algorithm for approximating color here: https://www.compuphase.com/cmetric.htm Was wondering if you are interested in implementing it in your plugin. Also, thanks for the plugin! It's now essential for me working on pixelarts. ❤️ Quote Link to comment Share on other sites More sharing options...
MJW Posted July 28, 2021 Author Share Posted July 28, 2021 4 hours ago, David Feng said: Was wondering if you are interested in implementing it in your plugin. I'll give it some consideration. I know straight Euclidean distance isn't a particularly good method for color comparison. I'd probably have to disable taking opacity into account when using the more complex color metric. I doubt the method I use can be extended to it. Quote 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.