---
name: ximgview
description: "View BMP images from the PNG driver."
keywords: [ display, graphics, raster, vector, visualization ]
---

# ximgview

View BMP images from the PNG driver.

=== "Command line"

    **ximgview**
    **image**=*name*
    [**percent**=*integer*]
    [**--verbose**]
    [**--quiet**]
    [**--qq**]
    [**--ui**]

    Example:

    ```sh
    ximgview image=name
    ```

=== "Python (grass.tools)"

    *grass.tools.Tools.ximgview*(**image**,
        **percent**=*10*,
        **verbose**=*None*,
        **quiet**=*None*,
        **superquiet**=*None*)

    Example:

    ```python
    tools = Tools()
    tools.ximgview(image="name")
    ```

    This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

=== "Python (grass.script)"

    *grass.script.run_command*("***ximgview***",
        **image**,
        **percent**=*10*,
        **verbose**=*None*,
        **quiet**=*None*,
        **superquiet**=*None*)

    Example:

    ```python
    gs.run_command("ximgview", image="name")
    ```

## Parameters

=== "Command line"

    **image**=*name* **[required]**  
    &nbsp;&nbsp;&nbsp;&nbsp;Image file  
    **percent**=*integer*  
    &nbsp;&nbsp;&nbsp;&nbsp;Percentage of CPU time to use  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *10*  
    **--help**  
    &nbsp;&nbsp;&nbsp;&nbsp;Print usage summary  
    **--verbose**  
    &nbsp;&nbsp;&nbsp;&nbsp;Verbose module output  
    **--quiet**  
    &nbsp;&nbsp;&nbsp;&nbsp;Quiet module output  
    **--qq**  
    &nbsp;&nbsp;&nbsp;&nbsp;Very quiet module output  
    **--ui**  
    &nbsp;&nbsp;&nbsp;&nbsp;Force launching GUI dialog

=== "Python (grass.tools)"

    **image** : str | io.StringIO, *required*  
    &nbsp;&nbsp;&nbsp;&nbsp;Image file  
    &nbsp;&nbsp;&nbsp;&nbsp;Used as: file, *name*  
    **percent** : int, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Percentage of CPU time to use  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *10*  
    **verbose** : bool, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Verbose module output  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *None*  
    **quiet** : bool, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Quiet module output  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *None*  
    **superquiet** : bool, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Very quiet module output  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *None*  

    Returns:

    **result** : grass.tools.support.ToolResult | None  
    If the tool produces text as standard output, a *ToolResult* object will be returned. Otherwise, `None` will be returned.

    Raises:

    *grass.tools.ToolError*: When the tool ended with an error.

=== "Python (grass.script)"

    **image** : str, *required*  
    &nbsp;&nbsp;&nbsp;&nbsp;Image file  
    &nbsp;&nbsp;&nbsp;&nbsp;Used as: file, *name*  
    **percent** : int, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Percentage of CPU time to use  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *10*  
    **verbose** : bool, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Verbose module output  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *None*  
    **quiet** : bool, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Quiet module output  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *None*  
    **superquiet** : bool, *optional*  
    &nbsp;&nbsp;&nbsp;&nbsp;Very quiet module output  
    &nbsp;&nbsp;&nbsp;&nbsp;Default: *None*

## DESCRIPTION

*ximgview* is a simple X11 image viewer for 32-bpp BMP images, as can be
created with the *[PNG](pngdriver.md)* and *[cairo](cairodriver.md)*
drivers. The display is continually refreshed.

## NOTES

The display driver must be configure to map the file, with
*GRASS_RENDER_FILE_MAPPED=TRUE*. This ensures that the file will remain
a constant size, rather than being truncated whenever it is updated.

## EXAMPLE

(bash shell syntax)

```sh
export GRASS_RENDER_FILE=map.bmp
export GRASS_RENDER_WIDTH=640
export GRASS_RENDER_HEIGHT=480
export GRASS_RENDER_IMMEDIATE=PNG
export GRASS_RENDER_FILE_MAPPED=TRUE
export GRASS_RENDER_FILE_READ=TRUE

d.erase
ximgview $GRASS_RENDER_FILE percent=50 &
d.rast elevation.dem
d.vect roads
```

## SEE ALSO

*[PNG driver](pngdriver.md), [cairo driver](cairodriver.md),
[wxpyimgview](wxpyimgview.md)*  
*[variables](variables.md)*

## AUTHOR

Glynn Clements

## SOURCE CODE

Available at: [ximgview source code](https://github.com/OSGeo/grass/tree/main/visualization/ximgview)
([history](https://github.com/OSGeo/grass/commits/main/visualization/ximgview))  
Latest change: Friday Apr 17 01:04:26 2026 in commit [5a31d54](https://github.com/OSGeo/grass/commit/5a31d549cc0150239894bd2b9e67250af87d38b5)
