ECONVERT(1)

πŸ’– ECONVERT(1) β€” the ExactImage Manual, but make it a group chat πŸ’–

okay bestie, sit down, hydrate, and let me tell you about econvert β€” it's the image converter of the ExactImage toolkit, and it lives in section 1 of the manual. yeah. we're doing man page section 1 today. iconic behavior honestly. ✨


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the whole vibe in one code block, no notes:

econvert [option...] [{-i | --input} input-file...]
         [{-o | --output} output-file...]

econvert {-h | --help}

that's it. that's the shape of it. πŸ¦‹


🌸 DESCRIPTION 🌸

so ExactImage is a fast C++ image processing library. and the way it eats? unlike a lot of other library frameworks, it lets you operate in several color spaces and bit depths natively, which means low memory and low computational requirements. slay. efficiency is the moment. πŸ’…

econvert is the command line frontend for that library, and it mimics ImageMagick's convert. BUT β€” and this is the plot twist, bestie β€” econvert syntax is NOT compatible with convert. 😭 they're cousins, not twins. do not just copy-paste your convert commands and expect a happy ending.


✨ OPTIONS ✨

🫢 Input/output

  • -i file, --input file β€” read the image from the file you specify. oh and optionally? filenames can be prefixed with the format name, like jpg:- or raw:rgb8-dump. so fancy. πŸ’–
  • -o file, --output file β€” save the output image to the file you specify. same deal: optionally prefix the filename with the format name, e.g. jpg:- or raw:rgb8-dump. 🌈
  • -a file, --append file β€” append the output image to the specified file. ⚠️ the existing image must have the same width as the one being appended. also, optionally, filenames can be prefixed with the format name, e.g. jpg:- or raw:rgb8-dump.
  • --compress method β€” use the specified compression method when writing images, e.g. G3, G4, Zip, ... the default depends on the output format. iykyk. πŸŽ€
  • --decompress method β€” use the specified decompression method when reading images.
  • --quality n β€” the quality used for writing compressed images. valid values are integers from 0 to 100. the default is 75. no cap.
  • --resolution xdpi [ydpi] β€” set metadata resolution. πŸ‘‘
  • --size width height β€” set image dimensions for raw images.
  • --split file... β€” split the image in the Y-direction into multiple images. it's giving βœ‚οΈ.

πŸ¦‹ Scaling, cropping, transformations

  • --bicubic-scale x β€” scale image data with a bi-cubic filter. use scale factor x.
  • --bilinear-scale x β€” scale image data with a bi-linear filter. use scale factor x.
  • --box-scale x β€” (down)scale image data with a box filter. use scale factor x.
  • --ddt-scale x β€” scale image data with data dependent triangulation. use scale factor x.
  • --nearest-scale x β€” scale image data to nearest neighbour. use scale factor x.
  • --scale x β€” scale image data using a method suitable for the specified factor x. let it pick, bestie. it knows. πŸ’…
  • --thumbnail x β€” quick and dirty down-scale for a thumbnail. use scale factor x. literally the "we ball" of scaling.
  • --crop x y w h β€” crop the specified area out of the image. πŸŽ€
  • --fast-auto-crop β€” fast auto crop.
  • --flip β€” flip the image vertically.
  • --flop β€” flip the image horizontally. (yes, flop. it's a real word here. we love her.)
  • --rotate n β€” rotate the image n degrees. πŸ”„

🌈 Colors

  • --brightness x β€” change the image brightness.
  • --contrast x β€” change the image contrast.
  • --saturation x β€” change the image saturation.
  • --lightness x β€” change the image lightness.
  • --hue x β€” change the image hue.
  • --negate β€” negate the image.
  • --gamma x β€” change the image gamma.
  • --normalize β€” transform the image to span the full color range.
  • --colorspace colorspace β€” convert image colorspace. valid values are: BW, BILEVEL, GRAY, GRAY1, GRAY2, GRAY4, RGB, YUV and CYMK. (yes, CYMK. exactly like that. don't @ me, that's what the page says. πŸ™ˆ)
  • --floyd-steinberg n β€” perform Floyd-Steinberg dithering using n shades.
  • --riemersma n β€” perform Riemersma dithering using n shades.

🧚 Filters

  • --blur stdev β€” perform gaussian blur with standard deviation stdev.
  • --deinterlace β€” shuffle every 2nd line. shuffle. like a playlist. 🎧
  • --edge β€” detect edges.
  • --convolve x11 x12 ... x1n ... xn1 xn2 ... xnn β€” convolve the image using the specified convolution matrix. yes, you literally type out the whole matrix. it's giving math homework but make it cute. ✨

πŸ“ Drawing

  • --foreground color β€” set foreground color.
  • --background color β€” set background color.
  • --font font β€” use the specified font for drawing text.
  • --text-rotation n β€” use the specified text rotation.
  • --text x1 y1 height text β€” draw text.
  • --stroke-width n β€” set stroke width for vector primitives.
  • --line x1 y1 x2 y2 β€” draw a line.

πŸ’œ Help

  • -h, --help β€” display help text and exit. our emotional support flag. 🫢

⭐ EXAMPLES ⭐

Basics

image data must be read using -i or --input, processing routines get selected by their name with two leading dashes (e.g. --rotate), and at any point the data might be written into a file with -o or --output. for example:

econvert -i lenea.tiff --box-scale 0.5 -o medium.png --box-scale 0.5 -o little.png

see how it chains? pipeline queen behavior. πŸ‘‘

Lossless transformations of JPEG files

the library delays image decoding as much as possible and provides lossless algorithms that work on compressed data (like JPEGs) directly. obsessed:

econvert -i AV220-Scan.JPG --resolution 300x300 -o 1.jpg --rotate 90 -o 2.jpg --rotate 180 -o 3.jpg --rotate -90 -o 4.jpg --flip -o 5.jpg --flop -o 6.jpg --scale 0.25 -o thumb.jpg

in this example 1.jpg will be created from the original JPEG DCT coefficients, those coefficients will be rearranged, and 2.jpg, 3.jpg, 4.jpg, 5.jpg and 6.jpg will be written without any additional loss in quality. 😭 so clean. only at the very end, for the image thumb.jpg, does the DCT actually get decoded β€” but thanks to the accelerated JPEG scaling, only partially.

Thumbnails of bi-level images

when 1 bit, black and white images get scaled down, the output often looks bad, because the library algorithms always operate in the color-space the image data is stored in. πŸ’€ to work around this, the colorspace must be changed (e.g. to 8 bit gray) before applying the box scaler. at the end, the result might be converted back to just a few shades of gray, like 2 or 4 bit:

econvert -i avision-bw-scan.pbm --colorspace gray8 --box-scale 0.125 --colorspace gray2 -o thumb.png

order matters bestie. colorspace first. periodt.

Faster JPEG down-scaling

if you don't care about quality and only care about throughput, you can force nearest neighbor scaling by just specifying a scale factor the JPEG decoder can accelerate (Β½, ΒΌ, or 1/8) and then apply the remaining scaling manually. to get faster scaling with the effective factor 1/3:

econvert -i big.jpg --scale .5 --nearest-scale 0.66 -o thumb.jpg

math girlies rise. πŸ”₯

Working with digital camera RAW data

a wide range of digital camera RAW formats is supported. usually decoding of RAW data should be transparent and automatic, however some formats are also valid TIFF files, and the embedded thumbnail might get picked in favour of the actual RAW content. in these cases the dcraw decoder can explicitly be requested with the decoder prefix of the input parameter:

econvert -i dcraw:img_0123.cr2 ...

to quickly extract the embedded thumbnail preview, specify thumb as the decompression method before the image is loaded:

econvert --decompress thumb -i dcraw:img_0123.cr2 ...

Loading arbitrary raw data

it is possible to load arbitrary raw data via the raw: codec specification. color-depth (colorspace) and size for the raw data have to be explicitly specified:

econvert --size 1696x32 --colorspace rgb8 -i raw:data-file ...

no defaults, no guessing, you tell it exactly what's up. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

exactimage(7)


πŸ’– AUTHORS πŸ’–

  • Jakub Wilk <jwilk@debian.org> β€” wrote this manual page for the Debian system. 🫢 thank you king.
  • https://exactcode.com/opensource/exactimage/ β€” this manual page incorporates texts found on the ExactImage homepage.

this manual page was written for the Debian system (and may be used by others).

permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation.

on Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2.


and that's the whole page, bestie!! πŸ’œ this one's econvert, from the ExactImage manual, dated 04/11/2010 β€” so yeah she's a vintage icon and she still ate. mwah. πŸŽ€βœ¨πŸ’