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
…or paste an image (Ctrl+V)
Resize · Crop · Rotate · Flip
JPG, PNG, WebP, GIF, BMP, HEIC, TIFF and more.

How to Crop PPM Images Online

  1. Choose Your PPM Files: Drag and drop PPM images onto the page or click "Choose PPM files" — up to 50 at once. The first photo opens in the editor and the rest line up as thumbnails below it; with two or more photos open, "Add more" adds files to the same batch.
  2. Set the Crop: In Crop, pick an "Aspect ratio" ("Free", "Original", 1:1, 4:3, 16:9 and more) or a platform size, then drag the box on the photo or type its width and height under "Crop area". "Shape" switches between "Rectangle" and "Circle (avatar)". The crop applies to every photo in the batch.
  3. Pick the Output Format (Optional): "Save as" keeps "Same as original" or saves as JPG, PNG, WebP or another format. For JPG, WebP and AVIF output, the "Quality" slider (40–100) trades file size against detail. Resize, Crop, Rotate and Flip all work in the same session, and "Undo" steps back.
  4. Download: Click the Download button, which names the output format (for example "Download PNG"), for one photo, or "Download all (.zip)" for a batch — "Download one by one" saves the files separately. PPM files are processed right in your browser, so they are not uploaded. 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 Controls vs pamcut

In this editor What it does Equivalent pamcut flag
Left offset — no typed field; drag the box (arrow keys nudge) Number of columns trimmed from the left -left
Top offset — no typed field; drag the box (arrow keys nudge) Number of rows trimmed from the top -top
"Crop area" W (px) Output column count -width
"Crop area" H (px) Output row count -height
Drag selection on preview Places and sizes the box visually (none — this is GUI only)

In pamcut, coordinates are inclusive of the starting pixel: -left 10 -top 20 -width 100 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?

Not for a standard 8-bit PPM (Maxval 255). Cropping is a pixel selection operation — the kept pixels are written to the output unchanged. There is no resampling and no compression artifact (PPM has no compression to begin with), so the RGB triplets in the cropped region are byte-for-byte identical to the source raster. The output is always written with Maxval 255, so a file with any other Maxval (for example a 16-bit one) is rescaled to 8-bit.

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 always written as P6 (a P3 input is saved as P6) — 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?

No. A PPM edited in your browser is redrawn in 8-bit colour, and the editor has no bit-depth setting, so a 16-bit PPM (Maxval 256–65535) comes out as 8-bit. For astronomy, HDR or scientific captures that need the full Maxval, crop with a tool that keeps 16 bits (ImageMagick, GIMP, pnmcut from Netpbm) and keep the original.

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 is GUI-based — drag-to-select the region, with typed Width/Height fields for exact sizing (there's no typed X/Y position field, so placement is by dragging). There's nothing to install, and it now batches up to 50 files at once with the same crop applied to each; for scripted automation with explicit -left/-top offsets, pamcut on the command line is still an option.

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 the resolution in the Resize tab, or convert to PPM to PNG for lossless 50–70% additional shrinkage. (A 16-bit PPM already comes out 8-bit, which halves it.)

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

Yes — drop up to 50 PPM files at once (a mixed batch works too). The crop region (or aspect-ratio preset) you set applies to every file in the batch; "Download all (.zip)" saves every cropped result in one ZIP, or use "Download one by one" to save them separately.

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, type Width=floor(W/2) and Height=floor(H/2) into the W and H boxes under "Crop area", then drag the crop box to the top-left corner — there's no typed X/Y field, so you place the box by dragging (arrow keys nudge it) and confirm the position visually on the preview.

Rate Crop PPM Tool

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