GMIC - display command problem

Hello.

Sorry about my first steps but i am stuck in dead end
As an alternative -output gmic have display command but for me its only “console output only, no display support”

Any suggest please. It’s much more comfortable to see result in “preview window” instead
export result file.
gmic was installed using homebrew macos hs 10.13.6

Best.

I think for MacOS you need to install an X Server…

1 Like

I don’t use MacOSX, so I can be of little help, but basically to get display working, the gmic executable you use must have been compiled with the display support activated (which means, on Mac, compiled against the X11 library). You can check this, basically with $ ldd /usr/bin/gmic | grep X11 (change the path to gmic with a correct path). If this command returns no result, you won’t be able to have display unless you find a version of the gmic binary somewhere where the display support has been enabled.

1 Like

Thank you very much, David!

On Mac ldd is typically not installed.

Using Home-brew you should have the command

otool -L $(which gmic) | grep X11

I think in any case you have to install XQuartz. I think it is default for Mac builds of gmic if it is not switched off intentionally. The other way is to use the pre-build from https://github.com/aferrero2707/gmic-osx/releases/tag/continuous, the latest one.

2 Likes

Thanks a lot! I never give up!)))
Karsten, can you please suggest how to continue:

Dans-MacBook-Pro:~ Tekatozuka$ otool -L /usr/local/Cellar/gmic/2.7.1/bin/gmic | grep X11
This command give a void result, and as David says early, my next attempt was to use cmake to repeat this step.

Already installed now! But the font size too small for me.

Dans-MacBook-Pro:~ Tekatozuka$ cmake -S /Users/Tekatozuka/Downloads/gmic-2.7.1 -B /usr/local/Cellar/gmic/2.7.1/
CMake Deprecation Warning at CMakeLists.txt:57 (cmake_policy):
The OLD behavior for policy CMP0046 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

– The CXX compiler identification is AppleClang 10.0.0.10001044
– The C compiler identification is AppleClang 10.0.0.10001044
– Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
– Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
– Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
– Found ZLIB: /usr/lib/libz.dylib (found version “1.2.11”)
– Found X11: /usr/X11R6/include
– Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib
– Looking for XOpenDisplay in /usr/X11R6/lib/libX11.dylib;/usr/X11R6/lib/libXext.dylib - found
– Looking for gethostbyname
– Looking for gethostbyname - found
– Looking for connect
– Looking for connect - found
– Looking for remove
– Looking for remove - found
– Looking for shmat
– Looking for shmat - found
– Looking for IceConnectionNumber in ICE
– Looking for IceConnectionNumber in ICE - found
X11_INCLUDE_DIR: /usr/X11R6/include
X11_INCLUDE_DIRs:
X11_LIBRARY_DIR: /usr/X11R6/lib
X11_LIBRARY_DIRS:
– Found TIFF: /usr/local/lib/libtiff.dylib (found version “4.0.10”)
– Found PNG: /usr/local/lib/libpng.dylib (found version “1.6.37”)
– Found JPEG: /usr/local/lib/libjpeg.dylib (found version “90”)
– The following OPTIONAL packages have been found:

  • X11
  • TIFF
  • ZLIB
  • PNG
  • JPEG

– Configuring done
– Generating done
– Build files have been written to: /usr/local/Cellar/gmic/2.7.1

Hmm, as long as I can see everything is fine. I’m neither a homebrew user nor ever used ccmake for the gmic cli, still after the build according your log you should have a ready built gmic cli!

Do in Terminal either
gmic version up
or
gmic demo
Upon start of gmic the X11 Icon should appear in the dock. gmic is automatically starting X11.

At least with a well configured homebrew you should get an output from
which gmic
where your executable is located.

Concerning XQuartz you need not the terminal started from XQuartz. gmic should only display an X11 window. To find out more do
echo $DISPLAY
in any terminal to see the proper X11 configuration. Or try in terminal xlogo

xlogo - is ok. Was show me the window “X”

Dans-MBP:~ Tekatozuka$ gmic demo
[gmic]-0./ Start G’MIC interpreter.
[gmic]-0./demo/ *** Error *** Command ‘check_display’: No display available.

gmic version up or brew ugrade gmic tell that lastest version is installed.

should i repeat cmake after?

Dans-MBP:~ Tekatozuka$ echo $DISPLAY
/private/tmp/com.apple.launchd.XeDLKsdhfI/org.macosforge.xquartz:0

Hmm, I’m not very helpful. Possibly the display is switched off in the cmake file. You could try to do ccmake instead of cmake to have the list of options, ccmake is the interactive way.Maybe you should ask David for help. The application of cmake is not Mac specific.

However to see gmic in action you should try to use the ready made gmic build from Andrea, see above the link! There is nothing to install, you have to call gmic then either by the full path (./.path.gmic_cli/gmic) or you put the location of the downloaded and unpacked folder into your PATH.

I won’t be of any help with the use of cmake unfortunately. I’ve never used it myself!

Hi Daniel
is “X Server” is the equivalent “X11/XQuartz”?

Yes, XQuarz is one of the X servers available :slight_smile:

1 Like

Hello.

thanks a lot! works perfect now. it’s crash only during resize host window ))
and print record - BadAccess (attempt to access private resource denied)
Actually, not sure where is the problem with cmake, homebrew or elsewhere.
anyway now it’s possible to deep dive into gmic, so I will try later to solve install problem

also a Natron don’t work with gmic plugin for me.

my scope is all about colour manipulations, hue modification and color space transforms

Best!

Did you download the latest build
https://github.com/aferrero2707/gmic-osx/releases/download/continuous/gmic-cli-20190912.tgz
and update “gmic update”?

yes, for both operations.

just a simple code from tut page
gmic 1280,720,1,1,‘x’ -normalize 0,1023 -display

and trying to resize the X window with gradient give me error:
Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 132 (MIT-SHM)
Minor opcode of failed request: 1 (X_ShmAttach)
Serial number of failed request: 41
Current serial number in output stream: 54

I cannot reproduce the error. I tried it with XQuartz (from xterm) and with X11 from MacPort.

Maybe reinstall XQuartz, log out and log in or try a reboot.

HA, there are some problems with the latest build from Andrea, will try an earlier one!

gmic 1280,720,1,1,x -normalize 0,255 -display
don’t show that behavior. Try to ask Andrea!

My local (macport based) build don’t show any problem
However problem is not really reproducible, it appears sometimes and sometimes not. Could be a Problem of X11. Do you have a second monitor? That does not work properly under X11.

the same error (possible - because without report) with demo command

at this moment not connected

I have to leave, no time any more. Repeated trials will help possibly. At least it helped here. Sometimes I switched even to synchronized monitors, that helped too.

Another one question about -display and X11

by default the image was fit in viewport by gmic with some dimension as proxy as the source is 4K. And during inspect the image using zoom (don’t now factor) gamma and color shifts.
Is it normal behavior?

the cross show the target place of zoom and normal colors and gamma

and with zoom

That is a min/max linear normalization always done in the displayed region. It can be switched with ctrl n inside the window! Besides several other switches. See Started a new interactive visualization command.

In fact it is the behavior of display2d. Do gmic h display2d!