CRUNCH(1)

๐Ÿ“ฆ
version 0.56.2 ยท 2 versions
, in ubuntu stonking

โœจ NAME โœจ

crunch โ€” Advanced DXTn Texture Compressor ๐ŸŽ€

welcome to CRUNCH(1), bestie โ€” straight outta the General Commands Manual, section 1. hydrate, sit up straight, we're compressing textures ๐Ÿ’–


๐Ÿ’… SYNOPSIS ๐Ÿ’…

crunch [options]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so crunch is a lossy texture compression command line tool, and it's for developers who distribute and use content in the DXT1/5/N or 3DC/BC5 compressed mipmapped GPU texture formats. it's giving "pipeline go brrr" ๐Ÿ”ฅ

this version has been upgraded with Unity improvements, added features, and extended system + hardware support. slay ๐Ÿ’…


๐ŸŒˆ OPTIONS ๐ŸŒˆ

๐Ÿ“ file stuff

  • -file filename โ€” the required input filename. wildcards? yes. multiple -file params? also yes, stack 'em bestie ๐Ÿซถ
  • -file @list.txt โ€” a whole list of files to convert, in a text file, fancy ๐Ÿ’–

Supported source file formats: dds, ktx, crn, tga, bmp, png, jpg/jpeg, psd

โš ๏ธ real talk: some file format variants are unsupported. see the docs for stb_image.h: https://github.com/nothings/stb Progressive JPEG files are supported, see: http://code.google.com/p/jpeg-compressor/
  • -out filename โ€” name of the output file
  • -outdir dir โ€” directory to drop output into
  • -outsamedir โ€” write the output file into the input directory
  • -deep โ€” recurse subdirectories, default=false
  • -nooverwrite โ€” don't overwrite files that already exist
  • -timestamp โ€” update only the files that actually changed
  • -forcewrite โ€” overwrite even read-only files ๐Ÿ˜ค
  • -recreate โ€” recreate the directory structure
  • -fileformat [dds,ktx,crn,tga,bmp,png] โ€” output file format, default=crn or dds

๐ŸŽฎ modes

  • -compare โ€” compare input and output files (no output files are written. none. zero. nada ๐Ÿ™ˆ)
  • -info โ€” only display input file statistics (also writes no output files)

๐Ÿงƒ misc. options

  • -helperThreads # โ€” set number of helper threads, 0-15, default=(# of CPU's)-1
  • -noTitle โ€” disable title output at run time
  • -noprogress โ€” disable progress output
  • -quiet โ€” disable all console output ๐Ÿคซ
  • -ignoreerrors โ€” keep processing files after errors. Note: the default behavior is to immediately exit whenever an error occurs ๐Ÿ’€
  • -logfile filename โ€” append output to a log file
  • -pause โ€” wait for keypress on error
  • -window <left> <top> <right> <bottom> โ€” crop window before processing
  • -clamp <width> <height> โ€” crop the image if it's larger than width/height
  • -clampscale <width> <height> โ€” scale the image if it's larger than width/height
  • -nostats โ€” disable all output file statistics (faster โšก)
  • -imagestats โ€” print various image quality statistics
  • -mipstats โ€” print statistics for each mipmap, not just the top mip
  • -lzmastats โ€” print size of output file compressed with LZMA codec
  • -split โ€” write faces/mip levels to multiple separate output PNG files
  • -yflip โ€” always flip texture on Y axis before processing
  • -unflip โ€” unflip texture if read from source file as flipped

๐Ÿ” image rescaling (mutually exclusive options)

these are mutually exclusive bestie, pick ONE, don't be greedy ๐Ÿ™ˆ

  • -rescale <int> <int> โ€” rescale image to specified resolution
  • -relscale <float> <float> โ€” rescale image to specified relative resolution
  • -rescalemode <nearest | hi | lo> โ€” auto-rescale non-power of two images
    • nearest โ€” use nearest power of 2
    • hi โ€” use next
    • lo โ€” use previous

๐Ÿ’Ž DDS/CRN compression quality control

  • -quality # (or /q #) โ€” set Clustered DDS/CRN quality factor [0-255]. 255=best DDS default quality is best possible. CRN default quality is 128.
  • -bitrate # โ€” set the desired output bitrate of DDS or CRN output files.

this option causes crunch to find the quality factor closest to the desired bitrate using a binary search. it's giving overachiever energy โœจ

๐Ÿงฌ low-level CRN specific options

  • -c # โ€” color endpoint palette size, 32-8192, default=3072
  • -s # โ€” color selector palette size, 32-8192, default=3072
  • -ca # โ€” alpha endpoint palette size, 32-8192, default=3072
  • -sa # โ€” alpha selector palette size, 32-8192, default=3072

๐Ÿช„ mipmap filtering options

  • -mipMode [UseSourceOrGenerate,UseSource,Generate,None] โ€” default mipMode is UseSourceOrGenerate
    • UseSourceOrGenerate: use source mipmaps if possible, or create new mipmaps.
    • UseSource: always use source mipmaps, if any (never generate new mipmaps)
    • Generate: always generate a new mipmap chain (ignore source mipmaps)
    • None: do not output any mipmaps
  • -mipFilter [box,tent,lanczos4,mitchell,kaiser] โ€” default=kaiser
  • -gamma # โ€” mipmap gamma correction value, default=2.2, use 1.0 for linear
  • -blurriness # โ€” scale filter kernel, >1=blur, <1=sharpen, .01-8, default=.9
  • -wrap โ€” assume texture is tiled when filtering, default=clamping
  • -renormalize โ€” renormalize filtered normal map texels, default=disabled
  • -rtopmip โ€” renormalize on the top mip-level too, default=disabled
  • -maxmips # โ€” limit number of generated texture mipmap levels, 1-16, default=16
  • -minmipsize # โ€” smallest allowable mipmap resolution, default=1

๐Ÿ—œ๏ธ compression options

  • -alphaThreshold # โ€” set DXT1A alpha threshold, 0-255, default=128
Note: -alphaThreshold also changes the compressor's behavior to prefer DXT1A over DXT5 for images with alpha channels (.DDS only).
  • -uniformMetrics โ€” use uniform color metrics, default=use perceptual metrics
  • -noAdaptiveBlocks โ€” disable adaptive block sizes (i.e. disable macroblocks).
  • -noNormalDetection โ€” disable normal map detection, default=disabled
  • -compressor [CRN,CRNF,RYG,ATI] โ€” set DXTn compressor, default=CRN
  • -dxtQuality [superfast,fast,normal,better,uber] โ€” endpoint optimizer speed.

sets the endpoint optimizer's max iteration depth. Default=uber. yes the setting is literally called uber, main character energy ๐Ÿ‘‘

  • -noendpointcaching โ€” don't try reusing previous DXT endpoint solutions.
  • -grayscalesampling โ€” assume shader will convert fetched results to luma (Y).
  • -forceprimaryencoding โ€” only use DXT1 color4 and DXT5 alpha8 block encodings.
  • -usetransparentindicesforblack โ€” try DXT1 transparent indices for dark pixels.

๐ŸŽจ output pixel format options

  • -usesourceformat โ€” use input file's format for output format (when possible).

All supported texture formats (Note: .CRN only supports DXTn pixel formats):

  • -DXT1
  • -DXT2
  • -DXT3
  • -DXT4
  • -DXT5
  • -3DC
  • -DXN
  • -DXT5A
  • -DXT5_CCxY
  • -DXT5_xGxR
  • -DXT5_xGBR
  • -DXT5_AGBR
  • -DXT1A
  • -ETC1
  • -ETC2
  • -ETC2A
  • -ETC1S
  • -ETC2AS
  • -R8G8B8
  • -L8
  • -A8
  • -A8L8
  • -A8R8G8B8

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Crunch is brought to you by, and bestie they ATE ๐Ÿ’–:


๐Ÿ› REPORTING BUGS ๐Ÿ›

found a bug? not on my watch. please report bugs here: https://github.com/DaemonEngine/crunch/issues


okay that's the whole page bestie, you're officially crunch-pilled ๐Ÿซถ this was the October 2025 edition of CRUNCH(1), no cap โ€” go compress something gorgeous ๐Ÿ’…โœจ
๐Ÿ“ฆ where this page comes from