Crop PPM

Crop PPM images online for free. Isolate regions of interest from scientific and processed images.

or drop photos here · up to 50 at once
JPG, PNG, WebP, GIF, BMP, TIFF, HEIC, AVIF, ICO, PSD, PPM. Everything happens in your browser; nothing is uploaded.

How to Crop PPM Images Online

  1. Upload Your PPM File: Click "+ Add Files" or drag and drop a .ppm image. Both raw P6 (binary) and plain P3 (ASCII) variants are accepted, including 8-bit and 16-bit Maxval files. Only the first file you pick is loaded — this editor works on one image at a time, not a batch queue.
  2. Set Crop Area (X, Y, Width, Height): Drag the on-image selection box, or enter exact pixel coordinates and dimensions. Coordinates start at the top-left corner of the source raster — the same origin convention used by pamcut, ImageMagick, and the underlying Netpbm row order.
  3. Adjust Compression and Bit Depth (Optional): Under Image Compression, pick a Quality Preset (Highest to Lowest), Target file size as % with Smart Scaling, Specific file size in KB/MB, or Image Quality (%). Under Bit Depth, choose 8-bit (Maxval 255, standard) or 16-bit (Maxval up to 65535, high-precision scientific data).
  4. Adjust Resolution (Optional) and Crop: Keep original resolution, scale by percentage, pick a preset (4320p down to 144p), or enter exact width/height — applied after the crop. Click "Crop" to download the cropped PPM. Processing happens locally in your browser: no sign-up, no watermark.

Why Crop PPM Images?

PPM (Portable PixMap) is the color image member of the Netpbm family — a "lowest common denominator" raster format whose header carries only a magic number (P6 raw or P3 ASCII), width, height, and Maxval, followed by uncompressed RGB pixel data. Because every pixel costs 3 bytes at 8-bit Maxval (or 6 bytes at 16-bit), files balloon fast: a 1920×1080 P6 image is roughly 6 MB before any header overhead. Cropping removes pixels you don't need — the only meaningful way to shrink a PPM without changing format or precision.

  • Isolate a region of interest in scientific imaging — astronomy CCD readouts, microscopy captures, and computer-vision datasets are routinely emitted as PPM by camera SDKs and by tools like cjpeg/djpeg. Cropping to the analysis window lets downstream code skip irrelevant pixels.
  • Trim borders from Netpbm pipelines — ppmtopgm, pnmscale, pnmcomp, and friends often produce images with padding or framing artifacts. A precise crop fits cleanly between any two stages of a cat in.ppm | pnmscale | pnmcrop > out.ppm-style pipeline.
  • Cut output from Linux/Unix screen captures — scrot --format ppm and xwdtopnm write screenshots in Netpbm formats; cropping isolates a single window or panel without touching pixel values.
  • Prepare PPM patches for ML training — many academic CV pipelines (Middlebury stereo, BSD500 segmentation, classic computer-vision course assignments) consume PPM directly. Pre-cropped patches keep the format constant across the pipeline.
  • Reduce file size for transfer — since PPM has no compression, cropping is the most effective lossless size reduction. A crop to 50% of the area drops file size by 50% exactly. Convert to PPM to PNG for further lossless gains, or PPM to JPG when format flexibility is acceptable.
  • Strip pnmcrop failed leftovers — pnmcrop only removes uniform-colored borders; mixed or noisy edges defeat it. A coordinate-based crop catches the cases pnmcrop misses.

PPM vs Other Lossless Image Formats

Property PPM (P6) PNG TIFF (uncompressed) BMP
Compression None Deflate (lossless) None / LZW / Deflate None (typically)
Color depth 1–16 bits per channel (Maxval 1–65535) 8 / 16 bits per channel 1–32 bits per channel 1 / 4 / 8 / 24 / 32 bits
Header complexity Minimal — magic / W / H / Maxval Chunked, with metadata Tagged (TIFF tags) DIB header
Alpha channel No (use PAM for alpha) Yes Yes Limited
1920×1080 8-bit size ~5.93 MB raw ~2–5 MB ~6–12 MB ~5.93 MB
Typical use Netpbm pipelines, CV research, scientific tools Web, archival, screenshots Print, archival, microscopy Windows legacy software

PPM Crop Coordinate Reference

Input What it does Equivalent pamcut flag
X (left offset, px) Number of columns trimmed from the left -left
Y (top offset, px) Number of rows trimmed from the top -top
Width (px) Output column count -width
Height (px) Output row count -height
Drag selection on preview Visual equivalent of the four numbers above (none — this is GUI only)

Coordinates are inclusive of the starting pixel: an X=10, Y=20, Width=100 crop keeps columns 10–109 and rows 20 onward, matching the row-major top-to-bottom raster order documented in the PPM specification.

Frequently Asked Questions

Does cropping a PPM image lose any quality?

No. Cropping is a pixel selection operation — the kept pixels are written to the output unchanged. There is no resampling, no requantization, and no compression artifact (PPM has no compression to begin with). The Maxval, bit depth, and exact RGB triplets in the cropped region are byte-for-byte identical to the source raster.

What's the difference between P6 (raw) and P3 (plain) PPM, and is the cropped output the same variant as my input?

P6 stores each sample as 1 or 2 raw binary bytes; P3 stores each sample as ASCII decimal text separated by whitespace. Both encode the same pixels, but P6 is roughly 3–5x smaller and faster to read. The Netpbm spec describes P6 as "the format above, which generally considered the normal one." Cropped output from xconvert is written as P6 by default — open the file in a text editor and you'll see the P6\n<width> <height>\n<maxval>\n header followed by binary data.

Can I crop a 16-bit PPM (Maxval > 255) without losing precision?

Yes — 16-bit PPM (Maxval 256–65535, where each sample takes 2 bytes) is preserved through cropping. The output keeps the original Maxval and per-channel bit depth unless you explicitly change Bit Depth to 8-bit in the compression options. Astronomy and HDR scientific captures should leave Bit Depth alone.

How is this different from the Netpbm pamcut and pnmcrop command-line tools?

pamcut is the Netpbm tool for coordinate-based cropping (-left, -right, -top, -bottom, -width, -height flags); pnmcrop only auto-removes uniform-colored borders and fails on noisy edges. xconvert's tool combines both modes — drag-to-select like a GUI, or enter exact pixel coordinates equivalent to pamcut flags. There's nothing to install, though it works on one file at a time rather than a whole batch; for scripted batches of files, pamcut on the command line is still the faster path.

Will cropping help if my PPM file is too large to email or upload?

Yes, proportionally. Because PPM is uncompressed, file size scales linearly with pixel count: cropping to 50% of the area produces a file 50% smaller. For larger reductions, also lower resolution under the resize options, drop Bit Depth from 16-bit to 8-bit (halves the file), or convert to PPM to PNG for lossless 50–70% additional shrinkage.

Can I crop multiple PPM files to the same dimensions in one batch?

Not on this page, and not anywhere on xconvert today — cropping isn't part of the batch-capable server-side tools. The editor here holds one file at a time: set the X/Y/Width/Height, crop, save, then + Start New and re-enter the same coordinates for the next file. For fixed-camera capture sets, stereo pairs, or sequential frames from a CV pipeline, that means repeating the same numbers — or scripting pamcut locally if the set is large.

Are PAM, PGM, and PBM files supported here too?

This page handles PPM specifically. For grayscale (PGM) or bilevel (PBM) Netpbm files, convert through PNG to PPM or use the corresponding format-specific tools. PAM (Portable Arbitrary Map, which adds an alpha channel) is not part of this tool's accepted extensions.

Should I crop the PPM directly or convert first and then crop?

If a downstream tool (ImageMagick script, OpenCV pipeline, academic dataset loader) requires PPM, crop in PPM. For everything else, the cropped result is smaller and more universally readable as PNG — try PPM to PNG after cropping, or use crop PNG on a converted file. Either order produces identical pixel data because all three operations (crop, PNG encode, no resample) are lossless.

How do I figure out the right crop coordinates if I only know "the top-left quarter"?

The PPM header lists width and height as the second and third values (in ASCII decimal). For the top-left quarter: X=0, Y=0, Width=floor(W/2), Height=floor(H/2). The drag-to-select preview shows live coordinates while you drag, which is usually the fastest way to locate a region of interest visually.

Rate Crop PPM Tool

★★★★✭
Rating: 4.7 / 5 - 42 reviews