mogrify(1)
๐ mogrify(1) ๐
hey bestie! welcome to the mogrify(1) page from the General Commands Manual. this is part 1, so buckle up ๐
โจ NAME โจ
okay so mogrify is literally that girl ๐
she resizes, blurs, crops, despeckles, dithers, draws on, flips, joins, re-samples, and does so much more. but here's the tea โ: she overwrites the original image file, no cap. whereas convert(1) writes to a different image file. periodt.
๐ธ SYNOPSIS ๐ธ
magick mogrify [options] input-file
๐ฆ OVERVIEW ๐ฆ
mogrify is part of the ImageMagick(1) squad, bestie ๐ซถ. you use it to resize, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more โจ. it's basically convert(1)'s twin, except the original image file gets overwritten with any changes you ask for. so like, be careful, okay? ๐
want the full lore? point your browser to file:///usr/share/doc/ImageMagick-7/www/mogrify.html or https://imagemagick.org/script/mogrify.php. iykyk ๐
๐ DESCRIPTION ๐
๐ Image Settings ๐
okay so here's the full rundown of all the image settings you can use, bestie. no skipping, we're going through every single one ๐:
-adjoinโ join images into a single multi-image file ๐-affine matrixโ affine transform matrix โจ-antialiasโ remove pixel-aliasing ๐ฆ-authenticate valueโ decrypt image with this password ๐-attenuate valueโ lessen (or intensify) when adding noise to an image ๐ญ-background colorโ background color ๐จ-bias valueโ add bias when convolving an image ๐-black-point-compensationโ use black point compensation ๐-blue-primary pointโ chromaticity blue primary point ๐-bordercolor colorโ border color ๐-caption stringโ assign a caption to an image ๐-cdl filenameโ color correct with a color decision list ๐-colorspace typeโ alternate image colorspace ๐จ-comment stringโ annotate image with comment ๐ฌ-compose operatorโ set image composite operator โจ-compress typeโ type of pixel compression when writing the image ๐พ-decipher filenameโ convert cipher pixels to plain pixels ๐-define format:optionโ define one or more image format options ๐ ๏ธ-delay centisecondsโ display the next image after pausing โณ-density geometryโ horizontal and vertical density of the image ๐-depth valueโ image depth ๐-direction typeโ render text right-to-left or left-to-right โ๏ธ-display serverโ get image or font from this X server ๐ฅ๏ธ-dispose methodโ layer disposal method ๐๏ธ-dither methodโ apply error diffusion to image ๐ซ๏ธ-encipher filenameโ convert plain pixels to cipher pixels ๐-encoding typeโ text encoding type ๐ค-endian typeโ endianness (MSB or LSB) of the image ๐-family nameโ render text with this font family ๐จโ๐ฉโ๐งโ๐ฆ-features distanceโ analyze image features (e.g. contrast, correlation) ๐-fill colorโ color to use when filling a graphic primitive ๐๏ธ-filter typeโ use this filter when resizing an image ๐ผ๏ธ-flattenโ flatten a sequence of images ๐ฅ-font nameโ render text with this font โ๏ธ-format typeโ image format type ๐-function nameโ apply a function to the image ๐งฎ-fuzz distanceโ colors within this distance are considered equal ๐-gravity typeโ horizontal and vertical text placement ๐งญ-green-primary pointโ chromaticity green primary point ๐-intensity methodโ method to generate intensity value from pixel ๐ก-intent typeโ type of rendering intent when managing the image color ๐ฏ-interlace typeโ type of image interlacing scheme ๐งฉ-interline-spacing valueโ set the space between two text lines ๐-interpolate methodโ pixel color interpolation method ๐-interword-spacing valueโ set the space between two words ๐-kerning valueโ set the space between two letters ๐ค-label stringโ assign a label to an image ๐ท๏ธ-limit type valueโ pixel cache resource limit ๐ฆ-loop iterationsโ add Netscape loop extension to your GIF animation ๐-matteโ store matte channel if the image has one ๐ญ-mattecolor colorโ frame color ๐ผ๏ธ-metric typeโ measure differences between images with this metric ๐-monitorโ monitor progress ๐-morphology method kernelโ apply a morphology method to the image ๐งฌ-orient typeโ image orientation ๐งญ-page geometryโ size and location of an image canvas (setting) ๐-path pathโ write images to this path on disk ๐พ-perceptible epsilonโ pixel value less than |epsilon| become epsilon or -epsilon ๐ต-pingโ efficiently determine image attributes ๐-pointsize valueโ font point size ๐-precision valueโ maximum number of significant digits to print ๐ข-preview typeโ image preview type ๐-quality valueโ JPEG/MIFF/PNG compression level ๐๏ธ-quietโ suppress all warning messages ๐คซ-read-mask filenameโ associate a read mask with the image ๐-red-primary pointโ chromaticity red primary point โค๏ธ-regard-warningsโ pay attention to warning messages โ ๏ธ-remap filenameโ transform image colors to match this set of colors ๐จ-repage geometryโ size and location of an image canvas ๐-respect-parenthesesโ settings remain in effect until parenthesis boundary ๐งท-sampling-factor geometryโ horizontal and vertical sampling factor ๐-scene valueโ image scene number ๐ฌ-seed valueโ seed a new sequence of pseudo-random numbers ๐ฒ-size geometryโ width and height of image ๐-stretch typeโ render text with this font stretch ๐๏ธ-stroke colorโ graphic primitive stroke color ๐๏ธ-strokewidth valueโ graphic primitive stroke width ๐๏ธ-style typeโ render text with this font style โจ-synchronizeโ synchronize image to storage device ๐-taintโ declare the image as modified ๐ท๏ธ-texture filenameโ name of texture to tile onto the image background ๐งต-tile-offset geometryโ tile offset ๐งฉ-treedepth valueโ color tree depth ๐ณ-transparent-color colorโ transparent color ๐ป-undercolor colorโ annotation bounding box color ๐จ-units typeโ the units of image resolution ๐-verboseโ print detailed information about the image ๐ฃ๏ธ-virtual-pixel methodโ virtual pixel access method ๐พ-weight typeโ render text with this font weight ๐๏ธ-white-point pointโ chromaticity white point โช-write-mask filenameโ associate a write mask with the image โ๏ธ
bestie, remember: mogrify overwrites your original file. always back up if you're not 100% sure, okay? ๐๐
โจ Image Operators โจ
okay bestie, these are the image operators โ the tools that actually do stuff to your pics. each one takes some args (or none), and you use them with mogrify to edit images in place. let's go through every single one, no skips, fr fr. ๐
-adaptive-blurgeometry โ adaptively blur pixels; the effect gets weaker near the edges. soft focus but smarter. โจ-adaptive-resizegeometry โ resize the image adaptively using data-dependent triangulation. lowkey fancy. ๐ฆ-adaptive-sharpengeometry โ adaptively sharpen pixels; the effect gets stronger near the edges. contrast where it matters. ๐ฅ-alphaoption โ set the alpha channel. option can beon,activate,off,deactivate,set,opaque,copy transparent,extract,background, orshape. yes, that's a lot of options. ๐-annotategeometry text โ annotate the image with text. like writing on it, but make it cute. ๐-auto-gammaโ automagically adjust the gamma level of the image. no cap, it just does it. โจ-auto-levelโ automagically adjust the color levels of the image. glow-up for your colors. ๐-auto-orientโ automatically orient the image. so it's not sideways, periodt. ๐-auto-thresholdmethod โ automatically perform image thresholding. let the algorithm decide. ๐ง-benchiterations โ measure performance. for when you wanna know how fast it's going. โฑ๏ธ-bilateral-blurgeometry โ a non-linear, edge-preserving, and noise-reducing smoothing filter. it's giving smooth but not blurry. ๐ง-black-thresholdvalue โ force all pixels below the threshold into black. dramatic much? ๐ค-blue-shiftโ simulate a scene at nighttime in the moonlight. mood lighting, but make it digital. ๐-blurgeometry โ reduce image noise and reduce detail levels. classic blur, but still iconic. ๐ซ-bordergeometry โ surround the image with a border of color. frame it up. ๐ผ๏ธ-brightness-contrastgeometry โ improve brightness / contrast of the image. make it pop. โจ-cannygeometry โ detect edges in the image. edge detection, but make it Canny. ๐-channelmask โ set the image channel mask. choose your channels wisely. ๐ก-charcoalradius โ simulate a charcoal drawing. artsy vibes. ๐จ-chopgeometry โ remove pixels from the image interior. like cropping but from the inside. ๐ณ-clahegeometry โ contrast limited adaptive histogram equalization. say that three times fast. ๐-clampโ keep pixel values in range (0-QuantumRange). no out-of-bounds behavior. ๐ง-clipโ clip along the first path from the 8BIM profile. if you know, you know. โ๏ธ-clip-maskfilename โ associate a clip mask with the image. mask up. ๐ญ-clip-pathid โ clip along a named path from the 8BIM profile. path to the tea. ๐ค๏ธ-colorizevalue โ colorize the image with the fill color. tint it up. ๐จ-color-matrixmatrix โ apply color correction to the image. matrix math but for colors. ๐ข-colorsvalue โ preferred number of colors in the image. limit the palette. ๐-color-thresholdstart_color-stop_color โ force all pixels in the color range to white, otherwise black. binary decisions. โซโช-connected-componentconnectivity โ connected-components uniquely labeled. label them all. ๐ท๏ธ-contrastโ enhance or reduce the image contrast. turn it up or down. ๐๏ธ-contrast-stretchgeometry โ improve contrast bystretchingthe intensity range. stretch it out. ๐ง-convolvecoefficients โ apply a convolution kernel to the image. math core. ๐งฎ-cycleamount โ cycle the image colormap. spin that color wheel. ๐ก-deskewthreshold โ straighten an image. fix that tilt. ๐-despeckleโ reduce the speckles within an image. bye, spots. ๐งน-distortmethod args โ distort images according to given method and args. bend it like Beckham. ๐-drawstring โ annotate the image with a graphic primitive. draw something. ๐๏ธ-edgeradius โ apply a filter to detect edges in the image. edge lord energy. ๐ช-embossradius โ emboss an image. give it that 3D texture. ๐๏ธ-enhanceโ apply a digital filter to enhance a noisy image. cleanup on aisle noise. ๐งผ-equalizeโ perform histogram equalization to an image. balance those levels. โ๏ธ-evaluateoperator value โ evaluate an arithmetic, relational, or logical expression. math but make it image. โ-extentgeometry โ set the image size. resize the canvas. ๐-extractgeometry โ extract area from image. cut it out. โ๏ธ-fftโ implements the discrete Fourier transform (DFT). math vibes. โจ-flipโ flip image vertically. upside down. ๐-floodfillgeometry color โ floodfill the image with color. fill it up. ๐จ-flopโ flop image horizontally. mirror mirror. ๐ช-framegeometry โ surround image with an ornamental border. fancy frame. ๐ผ๏ธ-gammavalue โ level of gamma correction. adjust the gamma. โ๏ธ-gaussian-blurgeometry โ reduce image noise and reduce detail levels. smooth like butter. ๐ง-geometrygeometry โ preferred size or location of the image. geometry is geometry. ๐-grayscalemethod โ convert image to grayscale. black and white realness. ๐-helpโ print program options. when you need help. ๐-hough-linesgeometry โ identify lines in the image. line detection. ๐-identifyโ identify the format and characteristics of the image. get the deets. ๐-iftโ implements the inverse discrete Fourier transform (DFT). reverse frequency. ๐-implodeamount โ implode image pixels about the center. suck them in. ๐ณ๏ธ-integralโ calculate the sum of values (pixel values) in the image. sum it up. โ-interpolative-resizegeometry โ resize image using interpolation. smooth resize. โจ-kmeansgeometry โ K means color reduction. cluster those colors. ๐ต-latgeometry โ local adaptive thresholding. threshold but local. ๐-layersmethod โ optimize or compare image layers. layer cake. ๐ฐ-levelvalue โ adjust the level of image contrast. level up. ๐ฎ-level-colorscolor,color โ level image with the given colors. two colors enter, one image leaves. ๐จ-linear-stretchgeometry โ improve contrast bystretching with saturationthe intensity range. stretch it with saturation. ๐งต-liquid-rescalegeometry โ rescale image with seam-carving. liquid rescale, it's giving magic. ๐ง-magnifyโ double the size of the image with pixel art scaling. zoom in, pixel style. ๐-mean-shiftgeometry โ delineate arbitrarily shaped clusters in the image. shift those means. ๐-mediangeometry โ apply a median filter to the image. median filter, not mean. ๐งฎ-modegeometry โ make each pixel the 'predominant color' of the neighborhood. mode vibes. ๐จ-modulatevalue โ vary the brightness, saturation, and hue. modulate it. ๐๏ธ-monochromeโ transform image to black and white. no color, just contrast. โซโช-motion-blurgeometry โ simulate motion blur. whoosh. ๐จ-negateโ replace each pixel with its complementary color. invert it. ๐-noisegeometry โ add or reduce noise in an image. noise core. ๐ป-normalizeโ transform image to span the full range of colors. normalize it. ๐-opaquecolor โ change this color to the fill color. make it opaque. ๐จ-ordered-ditherNxN โ add a noise pattern to the image with specific amplitudes. ordered dither, retro vibes. ๐บ-paintradius โ simulate an oil painting. paint me like one of your French girls. ๐จ-polaroidangle โ simulate a Polaroid picture. shake it like a Polaroid picture. ๐ธ-posterizelevels โ reduce the image to a limited number of color levels. posterize it. ๐ผ๏ธ-printstring โ interpret string and print to console. print it. ๐จ๏ธ-profilefilename โ add, delete, or apply an image profile. profile management. ๐-quantizecolorspace โ reduce colors in this colorspace. quantize it. ๐-radial-blurangle โ radial blur the image. spin blur. ๐-raisevalue โ lighten/darken image edges to create a 3-D effect. raise it up. ๐๏ธ-random-thresholdlow,high โ random threshold the image. chaos threshold. ๐ฒ-range-thresholdvalues โ perform either hard or soft thresholding within some range of values in an image. range threshold. ๐-regiongeometry โ apply options to a portion of the image. region locked. ๐บ๏ธ-renderโ render vector graphics. render it. ๐จ-resamplegeometry โ change the resolution of an image. resample it. ๐-resizegeometry โ resize the image. classic resize. ๐-rollgeometry โ roll an image vertically or horizontally. roll it. ๐ฒ-rotatedegrees โ apply Paeth rotation to the image. rotate it. ๐-samplegeometry โ scale image with pixel sampling. sample it. ๐-scalegeometry โ scale the image. scale it. โ๏ธ-segmentvalues โ segment an image. segment it. ๐งฉ-selective-blurgeometry โ selectively blur pixels within a contrast threshold. selective blur. ๐ฏ-sepia-tonethreshold โ simulate a sepia-toned photo. vintage vibes. ๐-setproperty value โ set an image property. set it. โ๏ธ-shadedegrees โ shade the image using a distant light source. shade it. ๐ก-shadowgeometry โ simulate an image shadow. shadow it. ๐-sharpengeometry โ sharpen the image. sharpen it. ๐ช-shavegeometry โ shave pixels from the image edges. shave it. โ๏ธ-sheargeometry โ slide one edge of the image along the X or Y axis. shear it. ๐-sigmoidal-contrastgeometry โ lightness rescaling using sigmoidal contrast enhancement. sigmoidal contrast. ๐-sketchgeometry โ simulate a pencil sketch. sketch it. โ๏ธ-solarizethreshold โ negate all pixels above the threshold level. solarize it. โ๏ธ-sort-pixelsโ sort each scanline in ascending order of intensity. sort it. ๐ข-sparse-colormethod args โ fill in a image based on a few color points. sparse color. ๐จ-splicegeometry โ splice the background color into the image. splice it. ๐งฌ-spreadamount โ displace image pixels by a random amount. spread it. ๐ช๏ธ-statistictype geometry โ replace each pixel with corresponding statistic from the neighborhood. statistic it. ๐-stripโ strip image of all profiles and comments. strip it. ๐งน-swirldegrees โ swirl image pixels about the center. swirl it. ๐-thresholdvalue โ threshold the image. threshold it. โซโช-thumbnailgeometry โ create a thumbnail of the image. thumbnail it. ๐ผ๏ธ-tilefilename โ tile image when filling a graphic primitive. tile it. ๐งฑ-tintvalue โ tint the image with the fill color. tint it. ๐จ-transformโ affine transform image. transform it. ๐-transparentcolor โ make this color transparent within the image. transparent it. ๐ป-transposeโ flip image vertically and rotate 90 degrees. transpose it. ๐-transverseโ flop image horizontally and rotate 270 degrees. transverse it. ๐-trimโ trim image edges. trim it. โ๏ธ-typetype โ image type. type it. ๐ค-unique-colorsโ discard all but one of any pixel color. unique colors. ๐-unsharpgeometry โ sharpen the image. unsharp it. ๐ช-vignettegeometry โ soften the edges of the image in vignette style. vignette it. ๐ธ-wavegeometry โ alter an image along a sine wave. wave it. ๐-wavelet-denoisethreshold โ removes noise from the image using a wavelet transform. wavelet denoise. ๐งผ-white-balanceโ automagically adjust white balance of image. white balance it. โช-white-thresholdvalue โ force all pixels above the threshold into white. white threshold. โช
โจ Image Channel Operators โจ
-channel-fxexpression โ exchange, extract, or transfer one or more image channels. channel effects. ๐ก-separateโ separate an image channel into a grayscale image. separate it. ๐จ
โจ Image Sequence Operators โจ
bestie this whole block is about sequences โ aka when you're holding more than one image at once and you wanna do stuff to the whole lil squad ๐ซถ
-affinity filenameโ transform image colors to match this set of colors-appendโ append an image sequence top to bottom (use+appendfor left to right)-clutโ apply a color lookup table to the image-coalesceโ merge a sequence of images-combineโ combine a sequence of images-compareโ mathematically and visually annotate the difference between an image and its reconstruction-complex operatorโ perform complex mathematics on an image sequence-compositeโ composite image-copy geometry offset,โ copy pixels from one area of an image to another-crop geometryโ cut out a rectangular region of the image-deconstructโ break down an image sequence into constituent parts-evaluate-sequence operatorโ evaluate an arithmetic, relational, or logical expression-flattenโ flatten a sequence of images-fx expressionโ apply mathematical expression to an image channel(s)-hald-clutโ apply a Hald color lookup table to the image-morph valueโ morph an image sequence-mosaicโ create a mosaic from an image sequence-poly termsโ build a polynomial from the image sequence and the corresponding terms (coefficients and degree pairs)-process argumentsโ process the image with a custom image filter-separateโ separate an image channel into a grayscale image-smush geometryโ smush an image sequence together-write filenameโ write images to this file
๐ Image Stack Operators ๐
and this next crew is your stack โ the actual lineup of images you're juggling, and how you shuffle it around ๐
-delete indexesโ delete the image from the image sequence-duplicate count,indexesโ duplicate an image one or more times-insert indexโ insert last image into the image sequence-reverseโ reverse image sequence-swap indexesโ swap two images in the image sequence
๐ Miscellaneous Options ๐
the grab-bag, the odds and ends, the little extras that don't fit anywhere else but are lowkey iconic โจ
-debug eventsโ display copious debugging information-distribute-cache portโ distributed pixel cache spanning one or more servers-helpโ print program options-log formatโ format of debugging information-list typeโ print a list of supported option arguments-versionโ print version information
okay so here's a lil thing you need to know, and it's giving very important ๐ซถ
by default, the image format of file is figured out from its magic number (yes, real term, iconic name, no notes). but if you wanna be specific and lock in a particular format, you've got two moves:
- put an image format name and a colon before the filename โ like
ps:image - or just name the file so the format is the suffix โ like
image.ps
and if you want standard input or standard output? put - as the file. that's it, that's the whole trick ๐
๐ฅ SEE ALSO ๐ฅ
๐ COPYRIGHT ๐
Copyright (C) 1999 ImageMagick Studio LLC. Additional copyrights and licenses apply to this software, see file:///usr/share/doc/ImageMagick-7/www/license.html or https://imagemagick.org/license/
and that's a wrap on mogrify(1) bestie!! ๐ this whole thing is ImageMagick, stamped with the date 2009/01/10 01:00:00, and it lives in the manual as mogrify(1). go forth and batch-process ur images, you absolute legend ๐
๐ฆโจ
๐ฆ where this page comes from
- alpine 3.24: imagemagick-doc 7.1.2.35-r0 ยท ImageMagick
- arch rolling: imagemagick 7.1.2.35-1 ยท ImageMagick
- epel 10: ImageMagick 1:7.1.2.34-1.el10_3 ยท ImageMagick
- fedora 43: ImageMagick 1:7.1.2.32-1.fc43
- fedora 43: ImageMagick 1:7.1.2.32-1.fc43
- fedora 43: ImageMagick 1:7.1.2.34-1.fc43 ยท ImageMagick
- fedora 43: ImageMagick 1:7.1.2.34-1.fc43 ยท ImageMagick
- fedora 44: ImageMagick 1:7.1.2.13-2.fc44 ยท ImageMagick
- fedora 44: ImageMagick 1:7.1.2.13-2.fc44 ยท ImageMagick
- fedora 44: ImageMagick 1:7.1.2.32-1.fc44
- fedora 44: ImageMagick 1:7.1.2.32-1.fc44
- fedora 44: ImageMagick 1:7.1.2.34-1.fc44 ยท ImageMagick
- fedora 44: ImageMagick 1:7.1.2.34-1.fc44 ยท ImageMagick
- fedora 44: ImageMagick 1:7.1.2.35-1.fc44 ยท ImageMagick
- fedora 44: ImageMagick 1:7.1.2.35-1.fc44 ยท ImageMagick
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms