---
name: "pkdumpimg"
section: "1"
platform: "linux"
package: "pktools"
version: "2.6.7.6+ds-6+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pkdumpimg"
---

# pkdumpimg(1)

program to dump image content to ASCII or STDOUT

## NAME

pkdumpimg - program to dump image content to ASCII or STDOUT

## SYNOPSIS

FC**pkdumpimg**F\[0\]  FC**-i**F\[0\] *input* \[FC**-o**F\[0\] *output*\] \[*options*\] \[*advanced options*\]

## DESCRIPTION

**pkdumpimg** dumps the content of a raster dataset to (standard) output (screen or filename). The default is to dump the output in matrix format. Use FC**-of**F\[0\] line to dump each pixel value on a separate line, preceded by its position (x and y value). You can specify a bounding box to dump with either the extent of an OGR vector dataset or via the options FC**-ulx**F\[0\] FC**-uly**F\[0\] FC**-lrx**F\[0\] and FC**-lry**F\[0\].

## OPTIONS

- FC**-i**F\[0\] *filename*, FC**--input**F\[0\] *filename*

  input image file

- FC**-o**F\[0\] *filename*, FC**--output**F\[0\] *filename*

  Output ASCII file (Default is empty: use STDOUT)

- FC**-of**F\[0\] *matrix\|line*, FC**--oformat**F\[0\] *matrix\|line*

  Output format (matrix form or list (x,y,z) form). Default is matrix form

- FC**-b**F\[0\] *band*, FC**--band**F\[0\] *band*

  band index to crop

- FC**-e**F\[0\] *vector*, FC**--extent**F\[0\] *vector*

  get boundary from extent from polygons in vector file

- FC**-ulx**F\[0\] *value*, FC**--ulx**F\[0\] *value*

  Upper left x value bounding box (in geocoordinates if georef is true)

- FC**-uly**F\[0\] *value*, FC**--uly**F\[0\] *value*

  Upper left y value bounding box (in geocoordinates if georef is true)

- FC**-lrx**F\[0\] *value*, FC**--lrx**F\[0\] *value*

  Lower left x value bounding box (in geocoordinates if georef is true)

- FC**-lry**F\[0\] *value*, FC**--lry**F\[0\] *value*

  Lower left y value bounding box (in geocoordinates if georef is true)

- FC**-v**F\[0\] *level*, FC**--verbose**F\[0\] *level*

  verbose (Default: 0)

Advanced options

- FC**-dx**F\[0\] *value*, FC**--dx**F\[0\] *value*

  Output resolution in x (in meter) (0.0: keep original resolution)

- FC**-dy**F\[0\] *value*, FC**--dy**F\[0\] *value*

  Output resolution in y (in meter) (0.0: keep original resolution)

- FC**-r**F\[0\] *resampling*, FC**--resampling-method**F\[0\] *resampling*

  Resampling method (near: nearest neighbour, bilinear: bi-linear interpolation).

- FC**-srcnodata**F\[0\] *value*, FC**--srcnodata**F\[0\] *value*

  set no data value(s) for input image

- FC**-dstnodata**F\[0\] *value*, FC**--dstnodata**F\[0\] *value*

  nodata value for output if out of bounds.

## EXAMPLE

We create a 5x5 raster dataset containing all 0 values except for its center (value=1)

```
FC
cat input.txt
0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0
      F[0]
```

Use [**pkascii2img**(1)](/pkascii2img/1.md) to create an raster dataset from *input.txt*

```
FC
pkascii2img -i input.txt -o output.tif -of GTiff -a_srs epsg:3035 -dx 25 -dy 25 -ulx 1000000 -uly 1000000
      F[0]
```

Dump the image content of *output.tif* to screen

```
FC
pkdumpimg -i output.tif
      F[0]
```

## SEE ALSO

[**pkascii2img**(1)](/pkascii2img/1.md)
