Creating a color palette from an specifc color

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Creating a color palette from an specifc color

Post by pablobhz » 2019-09-14T12:54:22-07:00

Hello Everyone.
Is MagickNET able to create a color palette from an specific color ?

Ex: I have the following color:
231,49,0 (RGB).

I would like to create a color palette based on this color. And then replace pixels accordingly.
Ex: If the pixel is 0,0,0 , replace with the main color (pixel is totally black)
If the pixel is something like 80,80,80 replace with a lighter version (since the pixel has more white on it than the original black pixels)

And so goes on.

Does ImageMagick or MagickNet provide any mechanism of doing so (at least get RGB values) ?

I'm uploading an image to exemplify my question. It has been made with another tool, but serves as example to show what i'm trying to achieve.

Image

Thanks in advance

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Creating a color palette from an specifc color

Post by snibgo » 2019-09-14T13:44:57-07:00

"Palette" is a technical term, meaning that pixel numbers do not directly define colours. Instead, each pixel has a single number that is an index to a table (a "palette") of colours. IM does not supply tools to directly edit palettes.

But perhaps you simply want to change colours in an image, regardless of whether a palette is used. Yes, if your image has a range of colours, you can change that to a different range. See http://www.imagemagick.org/script/comma ... vel-colors
snibgo's IM pages: im.snibgo.com

pablobhz
Posts: 69
Joined: 2016-05-07T06:47:14-07:00
Authentication code: 1151

Re: Creating a color palette from an specifc color

Post by pablobhz » 2019-09-14T14:57:37-07:00

Based on what i've read, this does exactly the job.
I'll supply a main color (RGB Values). Based on the amount of black or white on the destination pixel, it will change the range of this main color.

Do you know if MagickNEt has something equivalent of that ?

Post Reply