CROP(1)
π CROP(1) β from the General Commands Manual, and it's giving image-glowup π¦
β¨ NAME β¨
crop, iconv β frame, crop, and convert image.
πΈ SYNOPSIS πΈ
crop [ -c red green blue ] [ -i n | -x dx | -y dy | -r minx miny maxx
maxy ] [ -t tx ty ] [ -b red green blue ] [ file ]
iconv [ -u ] [ -c chandesc ] [ file ]
π DESCRIPTION π
Okay so crop reads an image(7) file β default standard input, bestie β crops it, and writes it as a compressed image(7) file to standard output. Iconic. π«Ά
There are literally two ways to specify a crop: by color value or by geometry. You can combine them in a single run of crop, and when you do, the color value crop is done first. Periodt.
π crop option vibes
-c red green blueβ takes a red-green-blue triplet as described incolor(3). For example, white is255 255 255. That corresponding color is used as a value to be cut from the outer edge of the picture; that is, the image is cropped to remove the maximal outside rectangular strip in which every pixel has the specified color. Yes, the whole maximal outside rectangular strip. She's thorough. π-i nβ insets the image rectangle by a constant amount,n, which may be negative to generate extra space around the image. Negativen= extra space, iykyk.-x dxβ similar to-i, but applies only to the x coordinate of the image.-y dyβ similar to-i, but applies only to the y coordinate of the image.-r minx miny maxx maxyβ specifies an exact rectangle. No guessing, just coordinates.-t tx tyβ specifies that the image's coordinate system should be translated bytx,tyas the last step of processing. Last step means last step, bestie.-b red green blueβ specifies a background color to be used to fill around the image if the cropped image is larger than the original, such as if the-ioption is given a negative argument. This can be used to draw a monochrome frame around the image. The default color is black.
π¦ iconv option vibes
iconv changes the format of pixels in the image file (default standard input) and writes the resulting image to standard output. Pixels in the image are converted according to the channel descriptor chandesc (see image(7)). For example, to convert a 4-bit-per-pixel grey-scale image to an 8-bit-per-pixel color-mapped image, chandesc should be m8. If chandesc is not given, the format is unchanged. The output image is by default compressed; the -u option turns off the compression.
-c chandescβ the channel descriptor used for the pixel conversion (seeimage(7)). If it's not given, the format stays unchanged.-uβ turns off compression for the output image. Compression is on by default.
πΈ EXAMPLE πΈ
To crop white edges off the picture and add a ten-pixel pink border, do this:
crop -c 255 255 255 -i -10 -b 255 150 150 imagefile > cropped
π SOURCE π
/src/cmd/draw/crop.c
π SEE ALSO π
π BUGS π
Iconv should be able to do Floyd-Steinberg error diffusion or dithering when converting to small image depths.
okay bestie, that's the CROP(1) page β footer check: it just says CROP(1), with no version or date listed, so this is your girl signing off ππ
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms