Jump to content

Trying to Create a Palette of 14-16 Million Colors


Recommended Posts

2 minutes ago, Forkanion said:

Yeah, why? Doesn't gmic have that feature?

 

It does. The command is index. I'm working on making a plugin now. All I need is a single line on the g'mic side of thing, and the rest is just generating a unique color Surface in C#. With a test, 10M palette takes 106 s to map into a 512,512 image.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

21 minutes ago, Reptillian said:

It does. The command is index.

 

Good luck, and I hope it works, but index suggests to me a feature that might find the nearest index in a linear array; but I'm doubtful about there being a built-in feature that finds the nearest point, using Euclidean distance, in a 3D array.  Finding the nearest value in a sorted linear array, using e.g. a binary search, is comparatively easy. Colors can't be sorted into a linear array.

Link to comment
Share on other sites

 

2 minutes ago, MJW said:

 

Have you not paid attention to the long discussion about the difficulty of matching a huge palette in a reasonable amount of time?

I was being sent multiple solutions, all of which I wasn't sure how to do, so  I thought the solution was there, I just didn't know how to use it because nobody was being elaborate enough. I've come across a 4096x4096 image which looked like it included every single color, even the grayscale. I'm trying to make an image like that, only with RGB 64 0 255 to RGB 192 0 255, including all the gray colors. Is there a plugin that does that, basically something that gives you every variation of a color range (R: 64 - 192), along with the whole grayscale version of that color range? If that can be done somehow, I can just use that feature, as well.

Link to comment
Share on other sites

8 hours ago, Reptillian said:

I have something for you. You can do 'colormap 0' in gmic.

 

sfSQkzn.png

 

The right image is all of the unique color found in the first image with the colormap command. I know this is a paint.net thread, but this solution is so much faster for your need and it is pretty specific. I will refer you to discuss.pixls.us if you find this is a good starting point.

Nevermind anything else, I can match colors to their closest value in the palette myself. I just need to know how to use the colormap command to single out every unique color together, like that cat image. Thanks for everything else you guys have done, I appreciate your time. 

Link to comment
Share on other sites

8 hours ago, Forkanion said:

I've come across a 4096x4096 image which looked like it included every single color, even the grayscale. I'm trying to make an image like that, only with RGB 64 0 255 to RGB 192 0 255, including all the gray colors.

I believe color curve would be the answer here.

8 hours ago, MJW said:

 

Good luck, and I hope it works, but index suggests to me a feature that might find the nearest index in a linear array; but I'm doubtful about there being a built-in feature that finds the nearest point, using Euclidean distance, in a 3D array.  Finding the nearest value in a sorted linear array, using e.g. a binary search, is comparatively easy. Colors can't be sorted into a linear array.

Not sure if this matches. IIRC, C++ and C# are almost as fast each other. So, if euclidean distance is too slow on the C#, it's a safe bet that gmic version use binary search. Let me call @G'MIC.

 

From a online document:

 

-index  Given a palette or look-up table of reference colors and a source image, the command determines for each source image pixel, the most closely matching reference color in the palette.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

4 hours ago, Reptillian said:

Given a palette or look-up table of reference colors and a source image, the command determines for each source image pixel, the most closely matching reference color in the palette.

 

I'm surprised -- almost amazed. That does sound exactly like what you want. If the source code is available, I'd like to look at it to see what the algorithm is.

Link to comment
Share on other sites

10 hours ago, Reptillian said:

I believe color curve would be the answer here.

Not sure if this matches. IIRC, C++ and C# are almost as fast each other. So, if euclidean distance is too slow on the C#, it's a safe bet that gmic version use binary search. Let me call @G'MIC.

 

From a online document:

 

-index  Given a palette or look-up table of reference colors and a source image, the command determines for each source image pixel, the most closely matching reference color in the palette.

How do I do the colormap 0 palette maker thing you did on g'mic? I can't find where I can enter that line of code.

Link to comment
Share on other sites

4 hours ago, Forkanion said:

How do I do the colormap 0 palette maker thing you did on g'mic? I can't find where I can enter that line of code.

On CLI or on G'MIC-QT->Various->Code. If using the latter, then type 'colormap 0'., then click ok. You should save the palette elsewhere.

Edited by Reptillian

G'MIC Filter Developer

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...