Home / Alt manpages / pbmtonokia(1)

  • pbmtonokia(1)
  • User command
  • linux

Convert PBM Icons to Nokia Smart Messaging Files with pbmtonokia

Old Nokia handsets took operator logos, group graphics and picture messages in their own Smart Messaging formats, and pbmtonokia gets a PBM there.

It produces uploadable hexcode, or a binary .nol, .ngg or .npm file, depending on the format you choose. Allow about fifteen minutes. The examples use the installed Netpbm 11.5.2 build, packaged here as netpbm 2:11.05.02-1.1build1.

You need a shell, a readable PBM file and enough space for the output. These conversions normally need no elevated privileges. Do not use sudo unless your input directory is deliberately restricted, and do not overwrite the only copy of an image or a previously useful output.

1. Check the installed command

Confirm which executable is being used and record its Netpbm version. This is a read-only step:

$ command -v pbmtonokia
/usr/bin/pbmtonokia
$ pbmtonokia --version
pbmtonokia: Using libnetpbm from Netpbm Version: Netpbm 11.5.2
pbmtonokia: Built from source dated 2024-03-31 09:09:47
pbmtonokia: Built by Debian

Your build date and packaging line may differ. What matters is that this is the expected Netpbm program and that it runs. The installed manual documents six format names: HEX_NOL, HEX_NGG, HEX_NPM, NOL, NGG and NPM.

2. Check the PBM before converting it

Inspect the input path without changing it. Replace the placeholder with your own file:

$ INPUT='/path/to/icon.pbm'
$ test -r "$INPUT" && echo 'input is readable'
input is readable
$ file "$INPUT"
/path/to/icon.pbm: Netpbm image data, portable bitmap, ASCII text
  • PBM is one bit per pixel, so this tool is not the right choice for greyscale or colour data.
  • The program accepts up to 255 rows or columns, but the Nokia formats have smaller useful dimensions: 72 by 14 or 78 by 21 for operator logos and group graphics, and 72 by 28 for picture messages.
  • Check dimensions before converting. Use a Netpbm tool available on your system, or inspect the PBM header directly.

Checkpoint

The original PBM stays unchanged. The converter reads it and writes its result to standard output; it never edits the source image.

3. Produce uploadable operator-logo hexcode

The default format is HEX_NOL, an uploadable Nokia Operator Logo hex string. Make the choice explicit in scripts and redirect it to a new destination:

$ OUTPUT='operator-logo.hex'
$ pbmtonokia -fmt HEX_NOL -net 62F210 "$INPUT" > "$OUTPUT"
$ test -s "$OUTPUT" && echo 'hex output written'
hex output written
$ head -c 64 "$OUTPUT"; echo
0605041582000062F2100008040155AA3CC3

The exact hex string depends on the image. The example network code, 62F210, is the manual's default and represents a six-hex-digit operator network code. Supply the code required by the operator logo you are creating; do not treat the default as a universal network identity.

Warning

Shell redirection truncates an existing destination before the program has succeeded. If operator-logo.hex already contains something you need, choose another name or make a deliberate backup first. A safe replacement pattern:

$ pbmtonokia -fmt HEX_NOL -net 62F210 "$INPUT" > operator-logo.hex.new
$ test -s operator-logo.hex.new
$ mv operator-logo.hex.new operator-logo.hex

If conversion fails, remove only the incomplete operator-logo.hex.new after checking it is the file you created. The original output stays in place. If the first command wrote directly over an old path, recovery depends on your backup or filesystem snapshots: the program has no undo operation.

4. Choose the message type and output container

Use HEX_NGG for uploadable Nokia Group Graphic hexcode and HEX_NPM for uploadable Nokia Picture Message hexcode. A picture message may include text, up to the format's 120-character limit:

$ pbmtonokia -fmt HEX_NGG "$INPUT" > group-graphic.hex
$ pbmtonokia -fmt HEX_NPM -txt 'Meet at 18:00' "$INPUT" > picture-message.hex
$ wc -c group-graphic.hex picture-message.hex
  30 group-graphic.hex
  74 picture-message.hex
 104 total

The byte counts are examples from a small test image and will vary. Check each file is non-empty and that the picture-message text is intentional. -txt defaults to no text; it is not a filename option.

The non-hex formats write binary files suitable for the older desktop editor formats Netpbm documents. Redirect them with matching extensions:

$ pbmtonokia -fmt NOL "$INPUT" > operator-logo.nol
$ pbmtonokia -fmt NGG "$INPUT" > group-graphic.ngg
$ pbmtonokia -fmt NPM -txt 'Meet at 18:00' "$INPUT" > picture-message.npm
$ file operator-logo.nol group-graphic.ngg picture-message.npm
operator-logo.nol:      data
group-graphic.ngg:      data
picture-message.npm:    data

Do not use head, a text editor or a terminal display as a binary-file validator. In a controlled test, the files begin with format markers such as NOL, NGG and NPM, but file may simply call them data. The separate HEX_* forms are easier to inspect because they are printable text.

Common traps

Missing or unreadable input is usually a path or permission problem. Check it directly:

$ ls -l "$INPUT"
$ test -r "$INPUT" && echo readable
readable
  • "First byte is not a Netpbm magic number". The input may be empty or not PBM at all. Recheck with file and keep the original for inspection. Do not rename a PNG or PGM to .pbm and expect the converter to accept it.
  • Handset or editor rejects the result even though the command exits cleanly. A successful exit only means pbmtonokia generated output, not that the dimensions match the receiving device. For an operator logo, verify both the six-digit network code and the logo dimensions; for a picture message, verify the text length and use HEX_NPM or NPM as required.

Done means

  • You confirmed the installed Netpbm version and selected a readable PBM input.
  • You chose the format that matches the Nokia object you need.
  • Operator-logo hexcode used an intentional six-hex-digit network code.
  • Picture-message text was optional, deliberate and no longer than 120 characters.
  • The output went to a new or explicitly replaceable file, leaving the PBM untouched.
  • You checked the output is non-empty and treated binary NOL, NGG and NPM files as binary data.