Home / Alt manpages / ppmtomitsu(1)

  • ppmtomitsu(1)
  • User command
  • linux

Prepare a PPM for a Mitsubishi S340-10 Printer

A wrong media setting on a dye-sub printer wastes real stock, so check depth, size and media before ppmtomitsu ever touches the printer. 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 conversion itself is unprivileged: do not reach for sudo just because a printer is involved. Access to a printer device or spool directory may have separate permissions, but that is a system configuration matter, not 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 is not a general-purpose image viewer or a printer queue command.

2. Check the PPM before converting it

The input needs a maximum sample value, or maxval, of 255. Use Netpbm's pamdepth to normalise a file at another depth, writing the result to a new file:

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

Keep the original until you have checked the result. This redirection creates or truncates source-255.ppm, so pick a new destination rather than pointing it at your only copy. If pamdepth reports an input error, stop and fix the PPM: do not feed a partial file to the printer converter.

Tip

Older Netpbm releases are a particular trap here. The manual records that versions before 10.40 treated PBM as maxval 1 in PPM programs. On such an old environment, convert PBM through ppmtoppm first, then run pamdepth 255. With the installed package, just supply a real PPM at the required depth.

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

Capture the generated data in a new file while testing. That lets you check the 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

Those messages are representative diagnostics from a two-colour, wider-than-tall sample; the wording and colour count depend on your image. The converted bytes go to standard output, so do not point that stream at your terminal. A successful run normally just returns to the prompt with no 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

To discard a test file, remove only the exact file after checking it is not the source image. The converter has no undo 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 is wider than it is tall, it may rotate it for the output orientation, which is why a wide sample reports "rotating": that 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 rather than an obstacle: do not work around it by guessing at dimensions or picking a larger media setting without checking what is physically loaded.

The converter uses a lookup-table method for images with 256 colours or fewer, which transfers faster. More colours still convert, just over the slower full-colour path. The -tiny option forces a memory-saving, line-by-line 24-bit method, worth trying if the machine starts paging heavily.

5. Select printer options deliberately

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

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 builds 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

Warning

Never pick a media value as a guess. The manual warns that a mismatch between the option and the media actually loaded can make the printer wait for the correct media, or shut itself off. That is a service interruption and can waste expensive stock.

6. Treat transmission as irreversible

Only send a captured file through your established printer workflow once you have checked the image, the options and the loaded media. Once transmission starts, 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 the file is readable, its maxval is 255, and the image fits the chosen media. A reported rotation is normally the documented orientation handling, not a failure. If the printer waits, compare the selected -media value against the stock actually loaded before changing anything.

Done means

  • Confirmed ppmtomitsu resolves to the intended Netpbm installation.
  • Checked the input is PPM with maxval 255, with the source still recoverable.
  • Created and checked a new, non-empty S340-10 file before transmission.
  • Chose media, copies, enlargement and optional 300 dpi or tiny mode intentionally.
  • Left every live printer connection alone during testing.