2023-11-07 14:13:33 +01:00
|
|
|
# rawtopgm
|
|
|
|
|
|
|
|
> Convert a raw greyscale image to a PGM image.
|
|
|
|
> More information: <https://netpbm.sourceforge.net/doc/rawtopgm.html>.
|
|
|
|
|
|
|
|
- Convert a raw greyscale image to a PGM image:
|
|
|
|
|
|
|
|
`rawtopgm {{width}} {{height}} {{path/to/image.raw}} > {{path/to/output.pgm}}`
|
|
|
|
|
|
|
|
- Convert a raw greyscale image to a PGM image, assume the image to be a square:
|
|
|
|
|
|
|
|
`rawtopgm {{path/to/image.raw}} > {{path/to/output.pgm}}`
|
|
|
|
|
|
|
|
- Convert a raw greyscale image in which the pixels come bottom-first instead of top-first to a PGM image:
|
|
|
|
|
2025-04-01 06:42:14 +03:00
|
|
|
`rawtopgm {{width}} {{height}} {{[-bt|-bottomfirst]}} {{path/to/image.raw}} > {{path/to/output.pgm}}`
|
2023-11-07 14:13:33 +01:00
|
|
|
|
2025-03-27 15:53:12 +00:00
|
|
|
- Ignore the first `n` bytes of the specified file:
|
2023-11-07 14:13:33 +01:00
|
|
|
|
2025-04-01 06:42:14 +03:00
|
|
|
`rawtopgm {{width}} {{height}} {{[-h|-headerskip]}} {{n}} {{path/to/image.raw}} > {{path/to/output.pgm}}`
|
2023-11-07 14:13:33 +01:00
|
|
|
|
|
|
|
- Ignore the last m bytes of each row in the specified file:
|
|
|
|
|
2025-04-01 06:42:14 +03:00
|
|
|
`rawtopgm {{width}} {{height}} {{[-r|-rowskip]}} {{m}} {{path/to/image.raw}} > {{path/to/output.pgm}}`
|
2023-11-07 14:13:33 +01:00
|
|
|
|
2025-03-27 15:53:12 +00:00
|
|
|
- Specify the maxval for the grey values in the input to be equal to `n`:
|
2023-11-07 14:13:33 +01:00
|
|
|
|
2025-04-01 06:42:14 +03:00
|
|
|
`rawtopgm {{width}} {{height}} {{[-m|-maxval]}} {{n}} {{path/to/image.raw}} > {{path/to/output.pgm}}`
|
2023-11-07 14:13:33 +01:00
|
|
|
|
|
|
|
- Specify the number of bytes that represent each sample in the input and that the byte-sequence is to be interpreted as little-endian:
|
|
|
|
|
2025-04-01 06:42:14 +03:00
|
|
|
`rawtopgm {{width}} {{height}} -bpp {{1|2}} {{[-l|-littleendian]}} {{path/to/image.raw}} > {{path/to/output.pgm}}`
|