Importing imagemagick under osx

I'm using import for mouse - select screenshot and under linux it works fine with import <filename>

.

In osx, instead of (snowleopard), the same command has no effect: the terminal stays with the cursor blinking, the mouse does not change shape, indicating that I am selecting an area and I can only ^ C it.

Using it instead:

import -window root a.png

      

it works great.

Any hints?

+3


source to share


1 answer


It's a quirky thing with X11, Imagemagick, and Snow Leopard. The command import

hangs and waits until you call the X display server . If you do not have X11 "XQuartz" running or installed, you will experience the same behavior as you observe. Here are some examples of an X server running on top of the OS X display manager.

 
convert x: -window root desktop # same as import

      

X11 desktop on Snow Leopard

Note that you can see the running xlogo app from the X server, but the pixelated garbage is generated by the display manager without the X.

To hijack one window, I need to run the following command, switch to the X application, and finally select the window.

convert x: app.png 

      



X application

Tips:

Why use Imagemagick? Snow leopard ships with utility screencapture

. Checkout guide . Just update your script to determine which utility to use.

IMPORT_BIN=$(which screencapture)
if [ -z "$IMPORT_BIN" ]; then
  # Not on OS X, use IM import command
  IMPORT_BIN="import"
else
  # On OS X, don't trust X display system
  IMPORT_BIN="$IMPORT_BIN -wS" 
fi
$(IMPORT_BIN) filename.png

      

For the most part, most of these problems have already been resolved. Make sure you have the latest versions of X11, Imagemagick, and start planning your migration from OS X 10.6.

+1


source







All Articles