![]() |
How to turn an RGB image into indexed mode specifying number of colors and... - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions) +--- Thread: How to turn an RGB image into indexed mode specifying number of colors and... (/Thread-How-to-turn-an-RGB-image-into-indexed-mode-specifying-number-of-colors-and) |
How to turn an RGB image into indexed mode specifying number of colors and... - trandoductin - 07-17-2018 Hello GIMP gurus, Is there a way to turn an image into indexed color mode with a custom palette while specifying a number of colors as well? I want to say turn a full RGB image into let's say 8 colors (indexed) but not generate optimum palette but 8 colors from my palette of colors. Quote:Currently, RE: How to turn an RGB image into indexed mode specifying number of colors and... - rich2005 - 07-17-2018 Not too sure that imposing a limited palette will work. How do you decide on the colours and match to an image. However, throwing one into the hat. 1. You can take your defined colours from a palette and paint onto a canvas in RGB https://i.imgur.com/iMjZCvw.jpg 2. Then that will convert to indexed (with whatever number of colours) to give a colormap of the defined colors. 3. Anything that goes into that indexed image assumes the properties both indexed and colormap. https://i.imgur.com/ibloavC.jpg but no guarantee that; a) they are a good match in the image b) all the colours are used. RE: How to turn an RGB image into indexed mode specifying number of colors and... - trandoductin - 07-17-2018 Thanks for your effort Rich! RE: How to turn an RGB image into indexed mode specifying number of colors and... - Ofnuts - 07-17-2018 Image>Mode>Indexed and provide a palette: [attachment=1933] RE: How to turn an RGB image into indexed mode specifying number of colors and... - rich2005 - 07-17-2018 the spec was ..as I read it.. Quote:.. but 8 colors from my palette of colors. so you still have to create a new palette with just 8 colors RE: How to turn an RGB image into indexed mode specifying number of colors and... - trandoductin - 07-17-2018 rich, you're right I want to also specify number of colors to use from palette. RE: How to turn an RGB image into indexed mode specifying number of colors and... - Ofnuts - 07-17-2018 Now that I see the actual problem.... However, "this process isn't the optimal" is an assertion that requires proof. It could well be the optimal, if not for the colors, then for the processing time. A way to check this is to bluntly try all combinations of eight DMC colors, compute a "distance" of the results to the initial image, and see which one give you the smallest distance(*). If you find a result which is noticeably better than the indexing then you can invest time trying to find a better algorithm. But optimizing colors when the color balance of the initial image is possibly already overloading the WTF meter and the threads will quickly change color due to UV light (or dirt) could be seen by some as being futile. (*) But be ready to acquire some Bitcoin-mining gear to speed this up, and you may have to come with the proper "distance" function. |