tifffastcrop(1)
πΈ tifffastcrop(1) πΈ
okay so bestie, you know that one manual, General Commands Manual? Yeah. This is the page for tifffastcrop, and I'm about to make it make sense. grab a snack, we're doing this π
π NAME π
tifffastcrop β extracts (crops) a rectangular region from a tiff file, avoiding loading the full source image input.tif into memory.
like, it just snips the bit you want. no cap. βοΈ
π«Ά USAGE π«Ά
that's the whole vibe. `-E` is doing the heavy lifting here, we'll get to it.
---
# π DESCRIPTION π
So `tifffastcrop` takes a <purple>single-image TIFF file</purple>, reads the rectangular region of width *w*, length *l*, with its top left corner at position (*x*,*y*) in pixels, and stores it into a new file. Simple as.
The function is similar to what `tiffcrop` from LibTIFF does, BUT β and this is the icon behaviour β `tifffastcrop` works also on <hotpink>very large TIFF files</hotpink> and it tries to read as little as possible from the source image into memory, whereas many programs open the whole image even if a very small region is requested. Therefore, it is much faster on large files. it's giving efficiency queen. π
If the `output` name is provided, the result is stored into a file with that name, in the format guessed from the extension of this filename if guess is possible (and in TIFF format if not), or in the format specified by options. Otherwise, the name given to the output file is created by adding the specification of the cropped region after the name of the original image and before the extension. cute, right? it names itself. main character energy fr. π¦
---
# π₯ PERFORMANCES π₯
In principle, cropping a (small) region from a large TIFF file can also be achieved with several tools, as `tiffcrop`, ImageMagick and GraphicsMagick. However β and here's the tea β most of the programs start with opening and deciphering the whole image either in memory or in a huge temporary file on the disk, which makes them quite slow, and often unable to complete the task by lack of memory. π
In contrast, `tifffastcrop` reads as little as possible from the source image. If the input file is a <cyan>tiled TIFF with reasonable tile size</cyan>, it should read barely more than the cropped region. This yields speedup and guarantees successful termination of the process even on computers with modest memory.
Eg. to crop a region of size `256x256` pixels in the middle of a JPEG-compressed tiled TIFF image of size `180224x70144`, on a computer with `16 GiB` of RAM and an `i7` CPU, `tifffastcrop` needs `0.3` seconds while GraphicsMagick needs more than `80` minutes and `tiffcrop` and ImageMagick fail. <rainbow>ate and left no crumbs</rainbow>. πβ¨
---
# β¨ OPTIONS β¨
- **`-v`** β Verbose monitoring. it talks to you about what it's doing. π£οΈ
- **`-T`** β Do not report TIFF errors or warnings. Under Windows, they are reported with noisy dialog boxes. (so if Windows is being extra with popups, this is your girl.) π
- **`-E <x in pixels>,<y in pixels>,<width in pixels>,<length in pixels>`** β Specification of the rectangular region to extract (crop). The top left corner (*x*,*y*) has to be inside the source image. Special value `-1` for width or length means "as big as possible". If the rectangle extends beyond the limits of the source image, its dimensions are adjusted. Examples: `-E 10,20,512,256` or `-E 0,0,-1,-1` (the latter means full image, whatever its dimensions). π―
- **`-o <offset in bytes>`** β Specify that only image in TIFF directory at position *offset* in source file will be read and handled. Takes precedence over `-d` option. like, it wins. periodt. π
- **`-d <range 1>[,<range 2>...]`** β Specify non-empty ranges of TIFF directory numbers (starting at `0`) from which extracts should be made. A range is specified as `<starting number>-<ending number>` or `<starting number>:<ending number>`. Ending number is included: for instance, range `3-3` means fourth directory. If starting number is omitted, is it assumed to be `0` (first directory). If ending number is omitted or `-1`, it means the last directory of the file.
- If several `-d` options are given, their ranges cumulate. (they stack, bestie π«Ά)
- **`-j[#]`** β Requests output of JPEG files rather than the default TIFF. Optional number *#* in the range `0` to `100` indicates wanted JPEG quality (default is `75`).
- **`-p[#]`** β Requests output of PNG files rather than the default TIFF. Optional number *#* in the range `0` to `9` indicates wanted PNG compression level (default is currently `6`).
- If several of `-j`, `-p`, and `-c` options are given, only the last one takes effect. β οΈ last one wins, always.
- **`-c <method>[:opt[:opt]...]`** β Requests output of TIFF files compressed with *method*. Method can be `none` for no compression, `jpeg`, `lzw`, `zip`... as provided by the LibTIFF library (see `libtiff (3TIFF)`). By default, the same compression as in the input TIFF file is used.
- Method-specific details of the wished compression can be specified by adding one or several group of characters starting with a colon `:` after the methods's name, as follows.
- Option to (TIFF compressed with) JPEG method:
- `:#` set compression quality level as in option `-j` (see above).
- LZW, Deflate (zip) and LZMA2 options:
- `:#` set predictor value
- `:p#` set compression level.
- For example, `-c lzw:2` to get LZW-encoded data with horizontal differencing, `-c zip:3:p9` for Deflate encoding with maximum compression level and floating point predictor, `-c jpeg:r:50` for JPEG-encoded RGB data at quality 50%. π₯
- If several of `-j`, `-p`, and `-c` options are given, only the last one takes effect. (yes, again. it's serious about this.)
---
# π SEE ALSO π
`tiffsplittiles(1)`, `tiffmakemosaic(1)`, `tiffsplit(1)`, `tiffcrop(1)`, `libtiff(3TIFF)`
**Home Page**
`https://pperso.ijclab.in2p3.fr/page_perso/Deroulers/software/largetifftools/`
go read the friends, they're all iconic in their own way. β¨
---
# π AUTHOR π
Christophe Deroulers
---
aaaand that's the whole page bestie, you understood it, I'm so proud π₯Ήπ this manual page is from **LargeTIFFTools 1.4.2**, dated **February 23rd, 2025** β shoutout to the version and the date, they ate. now go crop something huge and feel powerful. ππ¦β¨
π¦ where this page comes from
- debian trixie: largetifftools 1.4.2-1 Β· GPL-3.0-or-later
- ubuntu questing: largetifftools 1.4.2-1
- ubuntu resolute: largetifftools 1.4.2-2 Β· GPL-3.0-or-later
- ubuntu stonking: largetifftools 1.4.2-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms