using 5 to 6 color lookup table with gmic

I still have a lot to learn about gmic.

gmic -input macaw_large.jpg --colormap[-1] 5,1,1 -index[-2] [-1],0.5,1 -output[-2] 5color_macaw.gif

what I am trying to do is incorporate a predefined “palette” image in the above command.
I have built a palette.gif file (5 color look-up table) but am unsure how to refer to it.

I am trying to build a dithered image made up of 5 colors I have chosen.
The above command works but when I insert the palette.gif image it breaks.
I am unable to find any really obvious examples but have found the below tutorial. but still unsure of the exact syntax.

Any ideas would be appreciated.
I am using linux mint and bash shell not windows.

I’d say:

gmic macaw_large.jpg palette.gif index.. .,0.5,1 o 5color_macaw.gif

where palette.gif is a single row image containing 5 colored pixels.

Thanks David.

Your suggestions was exactly what I needed.
I had to add a “-” minus symbol to get it working in bash shell. (shown below) but you saved me a lot of extra effort :smile:

gmic macaw.jpg palette_macaw.gif -index… .,0.5,1 -o 5color_macaw.gif

That is because you are using an older G’MIC version. Currently it is 2.9.0.

@afre is right, if G’MIC requires you put the minus symbol then it is really old :stuck_out_tongue: You should think about updating it, otherwise you take the risk that the advice given here will not work 99% of the time !

Thanks David and Afre I have updated my version of G’MIC.