PVRG-JPEG(1)
π PVRG-JPEG(1) β the manual, but make it a group chat π
okay bestie, so this is pvrg-jpeg, a page from the General Commands Manual, and we're about to make JPEG compression make sense. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
pvrg-jpeg β JPEG compression and decompression. that's it, that's the whole vibe π
πΈ SYNOPSIS πΈ
pvrg-jpeg -iw ImageWidth -ih ImageHeight [-JFIF] [-q(l) Q-Factor]
[-a] [-b] [-d] [-k predictortype] [-n] [-O] [-y] [-z] [-g]
[-p PrecisionValue] [-t pointtransform]
[-r ResyncInterval] [-s StreamName] [-o OutBaseName]
[[-ci ComponentIndex1] [-fw FrameWidth1] [-fh FrameHeight1]
[-hf HorizontalFrequency1] [-vf VerticalFrequency1]
ComponentFile1]
[[-ci ComponentIndex2] [-fw FrameWidth2] [-fh FrameHeight2]
[-hf HorizontalFrequency2] [-vf VerticalFrequency2]
ComponentFile2]
....
look at all those flags. it's giving main character energy, honestly π
π¦ DESCRIPTION π¦
so pvrg-jpeg is a still-image compression/decompression program β it does JPEG encoding and decoding of multiple raster-scanned files. yes, multiple, it's an overachiever π
and what are these raster-scanned files, you ask? they're basically PGM (portable graymap) files, except with the PGM header yeeted off. a typical JPEG image is made of three of these little files, representing the Y, Cr, and Cb color channels. usually the Y (lumience) channel is full size, while the two chroma channels are half width and half height. but like, no particular channel really needs to be full size, so pvrg-jpeg needs to know the dimensions of the original image when it's out here creating jpegs. it can't read your mind, bestie π
π OPTIONS π
ImageWidthβ specifies the width of the original image. this should correspond to the width of the widest component, and thus the width of theoriginal image. all components have widths roughly corresponding to an integer decimation ratio from this specification. (in the synopsis that's the-iwflag β¨)ImageHeightβ specifies the height of the tallest component. this corresponds to the height of theoriginal image. (synopsis calls it-ihπΈ)-JFIFβ specifies that a JFIF header is placed on the encoded stream. unnecessary for decoding, so it's strictly a glow-up for the encoder πQ-Factorβ this option specifies a multiplicative factor for the quantization: each quantization coefficient of the default matrix is scaled by(Q-Factor/50). a Q-Factor of0is the same thing as a Q-Factor of50, because it disables this function.-qspecifies an 8 bit quantization matrix;-qlspecifies a 16 bit quantization matrix, which is useful for 12 bit data. iykyk π-aβ enables the double-precision floating point Reference DCT. (the default is Chen DCT.)-bβ enables the Lee DCT. (the default is Chen DCT.)-dβ enables decoding. see below, bestie β¬οΈ-gβ this option will put PGM headers on output files when decoding. putting the header back. iconic.-k predictortypeβ the lossless predictor type, specified as an integer between1-7. if specified, then lossless mode is used.-nβ this option specifies that the files should not be transmitted in interleaved format.-o OutBaseNameβ this will use the specified string as a base name for output files when decoding.-Oβ signals that the command interpreter will read from the standard input.-pβ specifies the precision. normally should be between2-16for lossless;8or12for DCT. if it is specified as a number greater than8then the input is considered to be unsigned shorts (16 bits, msb first). not aggressively checked β so like, it is NOT gonna hold your hand on this one π-s JPEGStreamNameβ when encoding, this will be used as the output file. when decoding, this will be used as the input file. multitasking queen π-t pointtransformβ specifies the shifting (right) upon loading input and shifting (left) upon writing input. generally used by the lossless mode only. can be used by the DCT mode to add or subtract bits.-yβ for decoding only, signals that no resynchronization is enabled, thus ignore any markers found in the data stream.-zβ enables use of default Huffman tables. this converts the coding from a two-pass system using the first pass to generate custom tables to a one-pass system using internal default tables. with this option, the compression speed is nearly doubled, but because the internal tables are not custom to the image, the compressed file size increases slightly. speed vs. size, the eternal struggle πResyncIntervalβ specifies a resync (restart) interval for the input file β if set to0(the default), resynchronization is disabled; otherwise it signifies the number of MDU between a resync marker. (that's-rin the synopsis β)StreamNameβ is the place to load (decoder)/store (encoder) the coded image β if unspecified it defaults toComponentFile1.jpg. (the-sflag, hello π)
π§ for every component in the image we have: π§
ComponentIndexβ describes the component index where the file data should be associated with. the possible values are between0and255. as a rule Y is in1; U is in2; V is in3. the file specifications, if left undisturbed, will result in component location of1for the first component file,2for the second component file, and so on. if-ciis specified for the previous component file, then the next component index defaults to the previous component index plus1. it auto-increments, it's so thoughtful π₯ΉFrameWidthβ describes the actual width of the component. this should be determinable by the size of the original image (ImageHeightandImageWidth) and the frequency sampling of that component. this program assumes that the sampling component will be round up to the nearest integer, and other programs may not necessarily follow that convention, so we allow precise specification of theFrameWidth. the program will notify the user if the framewidth and frameheight specifications do not correspond to a logical MDU pattern, and thus will refuse to take the input (in fact, sometimes rounding down will not result in a logical MDU pattern). so yes, it will absolutely reject your input and you will simply have to deal πFrameHeightβ describes the actual height of the component. multiplied together withFrameWidth, this should equal the file size of the component. see the above discussion on the actual specification. β¬οΈHor-Frequencyβ specifies the block sampling frequency of the component in the horizontal direction for every MDU transmitted.Ver-Frequencyβ specifies the block sampling frequency of the component in the vertical direction. when multiplied together with the horizontal frequency, it corresponds to the number of blocks of that component in the MDU.ComponentFilenβ represents the directory path location of the *n*th component file.
π EXAMPLES π
okay so, in order to encode a set of raster-scanned files: 128x128 in image.Y; 64x128 in image.U; and 64x128 in image.V into the file image.jpg, the command is
pvrg-jpeg -iw 128 -ih 128 -hf 2 image.Y image.U image.V -s image.jpg
and in order to decode a compressed file in image.jpg, you just type
pvrg-jpeg -d -s image.jpg
the three output files will be in image.jpg.1, image.jpg.2, image.jpg.3. the images can be displayed by the cv program. the images can also be converted to ppm and back through the programs cyuv2ppm and ppm2cyuv. those utility programs are available by anonymous ftp from havefun.stanford.edu:pub/cv/CVv1.2.1.tar.Z. π
and bestie, there are many more options within an internal command interpreter. please see the accompanying documentation in doc.ps for more details. the lore goes deep π
π BUGS π
somewhat slower than many commercial implementations, and some bugs are probably lurking around. lossless coding and decoding are especially slow. also β and this is the part where we hold hands β this program can produce jpeg files that other programs cannot understand. no cap. it's giving "my chaos, my rules" π
π AUTHOR π
Andy Hung
and that's the whole page, bestie π«Ά this was PVRG-JPEG(1) from the 4th Berkeley Distribution, dated 14 June 1993 β yeah she's an elder but she's still slaying β¨ππ
π¦ where this page comes from
- debian bookworm: pvrg-jpeg 1.2.1+dfsg1-6 Β· public_domain
- debian trixie: pvrg-jpeg 1.2.1+dfsg1-9 Β· public_domain
- ubuntu jammy: pvrg-jpeg 1.2.1+dfsg1-6 Β· public_domain
- ubuntu noble: pvrg-jpeg 1.2.1+dfsg1-7 Β· public_domain
- ubuntu questing: pvrg-jpeg 1.2.1+dfsg1-9
- ubuntu resolute: pvrg-jpeg 1.2.1+dfsg1-10 Β· public_domain
- ubuntu stonking: pvrg-jpeg 1.2.1+dfsg1-10 Β· public_domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms