Home / Alt manpages / display-im6.q16(1)

  • display-im6.q16(1)
  • User command
  • linux

Preview Images on X with ImageMagick display

You have a folder of images and a graphical desktop, and you just want to look at them without opening a full editor. You will learn a repeatable way to open an image or image sequence in an X window, resize the view without rewriting the source, and diagnose the two usual problems: no usable X display, and a file that is not what you thought it was. The examples target ImageMagick 6.9.12-98 Q16, supplied here by imagemagick-6.q16 version 8:6.9.12.98+dfsg1-5.2ubuntu0.1~esm13.

  • Time: about ten minutes.
  • You need: a readable image file, the display-im6.q16 command, and access to an X server.
  • Privileges: these are ordinary user commands. Do not use sudo just to view a personal image.

1. Confirm the installed command and X session

Check which executable will run and ask it for its version:

$ command -v display-im6.q16
/usr/bin/display-im6.q16
$ display-im6.q16 -version
Version: ImageMagick 6.9.12-98 Q16 x86_64

The local package also provides the aliases display and display-im6. The manual documents display-im6.q16 as the canonical command, so use that spelling in scripts and troubleshooting notes. The command talks to the X server selected by the DISPLAY environment variable:

$ printf 'DISPLAY=%s\n' "${DISPLAY:-<unset>}"
DISPLAY=:0

If DISPLAY is unset, or points to a session you cannot access, the viewer cannot create its window. In an SSH session, use a deliberately configured X forwarding session. Do not copy a random value from another login. A value such as :0 is an example, not a universal setting.

Checkpoint

You have a real image path and a usable X session. If this check fails, stop and fix the session before you change any image options.

2. Open one image

Pass the image path as the final argument. ImageMagick detects the format from the file's magic number, so a misleading suffix does not by itself decide how the file is read:

$ display-im6.q16 /path/to/photo.jpg

A window should appear. The manual's mouse controls help when the image is larger than the window:

  • Button 1: map or unmap the Command widget.
  • Button 2: press and drag to magnify a region.
  • Button 3: load an image from a visual image directory.

Close the window with its normal window-manager control when you are done.

To check the file before opening it, use the separate identify command if it is installed:

$ identify /path/to/photo.jpg
/path/to/photo.jpg JPEG 2400x1600 2400x1600+0+0 8-bit sRGB 1.2MiB 0.000u 0:00.000

Size, format and metadata wording can vary. What counts is that identify can read the file and reports dimensions. It does not prove that a remote X server is reachable.

3. Fit a large image without changing it

Use -geometry to set the window's preferred size and location. A percentage is a practical starting point for a large image:

$ display-im6.q16 -geometry 50% /path/to/photo.jpg

This sets a window preference. It is not an export and does not overwrite the input. If you need a fixed maximum size, use a geometry such as 1200x900, and the viewer will use the requested geometry for the image window.

Warning

Do not confuse this with -resize. The manual lists -resize as an image operator, so it changes the image held by the viewer. That is fine for inspection, but it is not a safe stand-in for making a thumbnail file. For a persistent derivative, make a separate, deliberate conversion step and choose a new destination first.

4. View several files as an image sequence

Give the command more than one input to hold an image sequence in one viewer session:

$ display-im6.q16 /path/to/frame-01.png /path/to/frame-02.png /path/to/frame-03.png

Use the Command widget to move through the loaded images. For an animated or repeating sequence, the installed manual documents -delay in centiseconds and -loop for the number of iterations:

$ display-im6.q16 -delay 10 -loop 0 /path/to/frame-*.png

Shell globbing happens before ImageMagick starts. If the pattern matches nothing, the shell may pass the literal pattern to the program, so check the input list first when the sequence matters:

$ printf '%s\n' /path/to/frame-*.png
/path/to/frame-01.png
/path/to/frame-02.png
/path/to/frame-03.png

Checkpoint

The list printed actual files, and the window opens with the expected number of images. A sequence viewer only reads its inputs, so it needs no elevated privileges.

5. Display vector artwork at its intended density

The manual says display defaults to the X screen resolution. For a vector input, set a density explicitly when physical sizing matters:

$ display-im6.q16 -density 72 /path/to/drawing.svg

-density is an image setting and accepts a geometry value. The documented 72 DPI example is a baseline, not a promise that every SVG's internal dimensions will look identical across viewers.

Tip

If the result is unexpectedly small or large, inspect the source dimensions and try an explicit density. Do not keep guessing with window geometry.

6. Handle X and input failures safely

If the command says it cannot open the display, verify the session without changing anything:

$ printf 'DISPLAY=%s\n' "${DISPLAY:-<unset>}"
$ test -n "$DISPLAY" && echo 'DISPLAY is set'
$ identify /path/to/photo.jpg

A successful identify separates an image-reading problem from an X connection problem. On a graphical desktop, run the viewer from a terminal inside that desktop. If you are remote, set up approved X forwarding or use a non-GUI inspection tool.

Security warning

Do not weaken X authentication or copy another user's cookie to make the window appear.

If ImageMagick rejects the input, check the path and permissions:

$ ls -l /path/to/photo.jpg
$ test -r /path/to/photo.jpg && echo readable

A readable file can still be corrupt or an unsupported format, and identify is a good first check. Keep any error text when you ask for help, along with the exact command and the ImageMagick version.

7. Avoid accidental writes

Most commands in this guide only read inputs and open a window. Be careful with options that write, or that alter the image in memory. The manual lists -write as an image setting, and shell redirection can truncate a destination before a later command has succeeded.

Warning

Do not test an output operation against the original file. Choose a new path, check that it is not already useful, and use a temporary name until you have inspected the result. If you did create an unwanted derivative, remove only that known derivative, after checking its path. There is no undo for deleting the wrong file.

Security warning

The -authenticate option accepts a password for decrypting an image. Keep such a password out of shell history, a shared process list and any pasted diagnostic. If you genuinely need to open an encrypted image, use the machine's approved secret-handling method.

Done means

  • Build known: display-im6.q16 -version identifies the installed ImageMagick 6 build.
  • X session ready: DISPLAY points to an X session you are authorised to use.
  • Opens without sudo: a single image opens, or a checked list of sequence files opens, without sudo.
  • Right option: -geometry is for a viewing preference and -density is for controlling vector resolution.
  • Inputs safe: input files are untouched, and any output path is separate, deliberate and checked before writing.