black and white CLUT.

hello everyone.
i would like to know (or ask for) a way to know if a CLUT will provide black&white output.
before grading i usually send a loop on available CLUT in /home/…/.cache/gmic/ to find inspiration.
being able to differentiate b&w and color would be helpful for me.
thanks in advance
lulu

It should be possible, yes.
In what for would you like to get the output of this test ?

This custom command is a way to get this info:

is_bwclut :
  to_clutname "$1" name=${} l[]
  if narg($GMIC_SYSTEM_PATH) g_path_unix=$GMIC_SYSTEM_PATH
  else g_path_unix=/usr/lib/gimp/2.0/plug-ins/
  fi
  path_test0=$path_clut
  path_test1=$_path_rc
  path_test2=${-path_gimp}plug-ins/
  path_test3=${-path_gimp}plug-ins/gmic_gimp_qt/
  path_test4=$g_path_unix
  repeat 5 file_clut=${path_test$>}/gmic_cluts.gmz
    l[] $file_clut onfail endl if $! break fi
  done
  if !$! # Download from G'MIC server
    i https://gmic.eu/gmic_cluts.gmz o ${path_clut}gmic_cluts.gmz
  fi
  k[${"nmd 1,"$name}]
  u {s==4}
  rm endl

You can then test CLUTS like this:

$ gmic v - is_bwclut polaroid_667 +e[] '${}'
1
$ gmic v - is_bwclut summer +e[] '${}'
0
1 Like

thank you David. glad to know it’s feasible.
will try that. (got everything embedded in a perl script.)
i’m not exactly sure where to put the custom command though.
lulu

I’ve put it in my custom command file, so the command should be available after a

$ gmic update

(considering you are running G’MIC 2.9.0+).

very cool. yes i am running 2.9.0. thank you