Home / Alt manpages / ppmtomitsu(1)

  • ppmtomitsu(1)
  • User command
  • linux

Prepare a PPM Image for a Mitsubishi S340-10 Printer

You will turn a PPM image into the Mitsubishi S340-10 printer data produced by ppmtomitsu, while checking the input depth, output size and media selection before a costly print job begins. The examples use Netpbm 11.5.2, installed here as package version 2:11.05.02-1.1build1. Allow about fifteen minutes if the PPM already exists.

You need a Linux shell, the netpbm package and a readable PPM file. The normal conversion is unprivileged. Do not use sudo merely because a printer is involved. Access to a printer device or spool directory may have separate permissions, but those are system configuration issues rather than a requirement of this converter.

1. Check the installed command

Confirm which executable your shell will run and record the package version:

$ command -v ppmtomitsu
/usr/bin/ppmtomitsu
$ dpkg-query -W -f='${Package} ${Version}\n' netpbm
netpbm 2:11.05.02-1.1build1

Other distributions use a different package query, but the first command is portable across ordinary POSIX shells. The installed manual describes the S340-10 format and the options available in this version. It does not describe a general-purpose image viewer or a printer queue command.

2. Check the PPM before converting it

The input should have a maximum sample value, or maxval, of 255. Use Netpbm's pamdepth to normalise a file that uses another depth, writing the normalised image to a new file:

$ pamdepth 255 /path/to/source.ppm > /path/to/source-255.ppm

Keep the original until the result has been checked. This redirection creates or truncates source-255.ppm, so choose a new destination rather than pointing it at the only copy. If pamdepth reports an input error, stop and fix the PPM rather than feeding a partial file to the printer converter.

For older Netpbm behaviour, PBM input is a particular trap: the manual records that releases before 10.40 treated PBM as maxval 1 in PPM programs. Convert PBM through ppmtoppm and then use pamdepth 255 if you are working with such an old environment. With the installed package, supply a real PPM with the required depth.

3. Make a file first, not a live printer connection

Capture the generated data in a new file while testing. This lets you inspect the command's exit status and keeps an accidental option mistake away from the printer:

$ ppmtomitsu /path/to/source-255.ppm > /path/to/image.s340-10
ppmtomitsu: found 2 colors - using the lookuptable-method
ppmtomitsu: rotating image for output

The messages above are representative diagnostics from a two-colour, landscape-shaped sample. Their wording and the colour count depend on the image. The converted bytes go to standard output, so do not send that stream to your terminal. A successful command normally returns to the prompt without a separate success message.

Checkpoint: verify the output exists and is non-empty:

$ test -s /path/to/image.s340-10 && echo 'S340-10 data written'
S340-10 data written

If you need to discard a test file, remove only the exact file after checking that it is not the source image. The converter does not provide an undo operation for a job already sent to a printer.

4. Understand automatic placement and size limits

ppmtomitsu tries to centre the image on the selected paper. If the image width is greater than its height, it may rotate the image for the output orientation. That is why a landscape sample can report that it is rotating. This is placement behaviour, not a resize request.

If the image is larger than the media allows, the converter fails before transmission. Treat that as a useful safety check. Do not work around it by guessing at dimensions or by selecting a larger media setting without checking what is physically loaded.

The converter uses a lookup-table method for images with no more than 256 colours, which can transfer faster. An image with more colours can still be converted, but may use the slower full-colour path. The -tiny option forces a memory-saving, line-by-line 24-bit method and is worth trying if the machine starts paging heavily.

5. Select printer options deliberately

Start with the defaults unless your printer and media require something else. The documented options are:

OptionMeaningDefault
-sharpness 1-4Set the sharpness designation.Current printer sharpness
-enlarge 1-3Enlarge by the selected factor.1
-media A|A4|AS|A4SDescribe the loaded media size.1184 by 1350 pixels
-copy 1-9Request the number of copies.1
-dpi300Double the allowed pixels for an S3600-30 in S340-10 compatibility mode.Off
-tinyUse the memory-saving 24-bit line method.Off

For example, this creates a two-copy file for A4 media with a modest enlargement:

$ ppmtomitsu -media A4 -enlarge 2 -copy 2 /path/to/source-255.ppm > /path/to/image-a4-two-copies.s340-10

Do not select a media value as a guess. The manual warns that a mismatch between the option and the media in the printer can make the printer wait for the correct media or be switched off. That is a service interruption and may waste expensive stock.

6. Treat transmission as irreversible

Only send a captured file through your established printer workflow after checking the image, options and loaded media. Once transmission has started, the manual says the job cannot be stopped sensibly without resetting the printer. There is no safe cancellation example to give here: do not test by pointing standard output at a live printer device.

If a conversion fails, keep the original PPM and read the diagnostic. Check that the file is readable, that its maxval is 255, and that the image fits the chosen media. If the command reports a rotation, that is normally the documented orientation handling rather than a failure. If the printer waits, compare the selected -media value with the stock actually loaded before changing anything.

Done means

  • ppmtomitsu resolves to the intended Netpbm installation.
  • The input is PPM with maxval 255, and the source remains recoverable.
  • A new, non-empty S340-10 data file was created and checked before transmission.
  • Media, copies, enlargement and optional 300 dpi or tiny mode were chosen intentionally.
  • No live printer connection was interrupted or reset during testing.