Does G'MIC has Maximum RGB?

GIMP is removing this filter and is already a hidden filter in GIMP 2.10 as you cannot access it anymore via the menu but need to call the search box (slash forward or Menu Help > Search and run a command) and input “RGB” or “Maximum RGB” to be able to use it

So my question is does G’MIC have some king of Maximum/Minimum RGB?
If so how it is called?

What is Maximum RGB filter in GIMP?
From
https://docs.gimp.org/2.6/en/plug-in-max-rgb.html

I added afre_saturatepixel (CLI only ATM).
Will be available to update in a few hours.

afre_saturatepixel:
    mode={ 0=min | 1=max }

  Saturate pixels of selected images.

  Default value: 'mode=1'.
1 Like

In G’MIC, this should be as simple to code as:

f "M = max(I); M*!(I-M)"

which is an expression you can copy/paste in one of the “Various / Custom Code” filter.

2 Likes

Ok, cool, I’ll wait :smiley:
(at the moment I got an error but, I’m no programmer and certainly put that code where I should not or may be it’s not online yet, or may be there is no code to enter and I have to wait the filter :laughing: )

It works!! I should select RGB channel, but it works fine!

Thank you so much :smiling_face_with_three_hearts:

Just one more (sorry), the minimum RGB?

1 Like
f "M = min(I); M*!(I-M)"
2 Likes

Thank you very much! :smiling_face_with_three_hearts:

The CLI command should work. However, it doesn’t consider the alpha channel of the host GUI; i.e., it includes it in the calculation, which is probably what you don’t want.

In the meantime, update your filters[1] image.

Then use Various / Custom Code, select Channel(s) = RGB [All], paste afre_saturatepixel 0 or afre_saturatepixel 1 and click the update button above the code.

image


Note [1] I renamed the command to afre_queryprimary, so depending on when you last update your filters, it could be that or afre_saturatepixel. The reason is that “saturate” is ambiguous. The new name kind of fits since we are outputting primary colours (R, G or B [and grey]) as a result of a min or max query.


PS As devs, we forget to remind people to update not just their filters but also their G’MIC installations (CLI and/or GUI to prerelease). If you don’t, you won’t have access to the newest commands.

2 Likes

Thanks for the reminder as this confirmed my thought, :smiley:

So I did upgraded to 2.9.8 :+1:
(I did lose the drop-down “Preview Mode”, though, is it normal? )

Anyway, I did try afre_saturatepixel 0 or afre_saturatepixel 1 and they are working perfectly :smiling_face_with_three_hearts:
Thank you very much @afre

Added median. To do: add GUI and no-alpha.

afre_queryprimary:
    mode={ 0=min | 1=max | 2=med }

  Query pixel minima, maxima or medians of selected images.

  Default value: 'mode=1'.

Update in a few hours.


Maybe you have to pull up/out the sub-window? I see

:+1: I’ll wait :wink:

I did it,

I did not uninstall the one before (2.9.7) and did downloaded and installed this one > gmic_ubuntu20-04_focal_amd64.deb straight on top…

May be I should have do an un-install with the 2.9.7 before? (or my distro? (Ubuntu-MATE 20.04.2 LTS)

EDIT: Wow the planet now is looking good from the start :grinning:

Silly me: you are quite right. I was using an older version. @David_Tschumperle

Oh, thanks, I feel better now as I’m not alone :laughing:

Edit Done~!

afre_queryprimary:
    mode={ 0=min | 1=max | 2=med },_skip_last_channel={ 0 | 1 }

  Query pixel minima, maxima or medians of selected images.

  Default values: 'mode=1' and 'skip_last_channel=0'.

image

Hi @afre
What do you mean by add GUI?
GUI as General User Interface? if so, how to do that, I am already using it, no?

I did updated the filters (button/Internet > success)
but I cannot find the “Query Primary” in your Testing/ @afre filters, nor via a search in G’MIC like your screenshot is showing (looks cool and is intuitive, with a good explanation about the last channel :+1: )

I did try to copy and paste your code, but I got an error.
What am I doing wrong?

1 CLI is the command line interface from the command prompt or terminal. GUI is the graphical user interface from the standalone or plugin.

2 It takes time for the servers to catch up: try updating again.

3 “Custom Code” lets you use CLI commands within the GUI. The quote below is the help information on how to use the CLI command; e.g., the default would be afre_queryprimary 1,0, which means mode=1 (max) and _skip_last_channel=0 (use the last channel in the query). This (afre_queryprimary 1,0) is what you type into “Custom Code”. The GUI version sets _skip_last_channel=1 by default because host editors usually include a alpha or transparency channel. PS The underscore before skip (_skip…) means you may omit the second parameter entirely if the default is fine (e.g., afre_queryprimary 1, as I have shown in previous posts).


It works for me right now.

image

image

2 Likes

Thanks for the explanations :+1:

So I just re-updated and, Woow, super cool, it works like a charm :smiling_face_with_three_hearts:
I like the medians and the alpha choice, that’s a really cool addition!

Thank you so much for this filter @afre