PPMTOYUV(1)
π PPMTOYUV(1) π
okay bestie, welcome to the Ppmtoyuv User Manual, general commands manual, section 1 π she's a lil niche but she SERVES.
β¨ NAME β¨
ppmtoyuv β convert a PPM image to an Abekas YUV file π
β¨ SYNOPSIS β¨
ppmtoyuv [ppmfile]
β¨ DESCRIPTION β¨
So. This program is part of Netpbm(1) π just so you know who she's running with.
ppmtoyuv reads a PPM image as input and produces an Abekas YUV file as output. That's the whole vibe. Read PPM, write Abekas YUV. Slay. π
The output file contains a raster of four byte YUV codes, and each one of those codes is uniquely associated with two side-by-side pixels in the image. The raster contains rows in order from top to bottom, and within each row, columns from left to right. No cap. So the output file size in bytes is twice the number of pixels in the image β do the math bestie, it checks out β¨
Now. Each YUV code is associated with two pixels from the input image, and we're gonna call them the left pixel and the right pixel. Here's how the four bytes break down, and honestly the way this is structured is kind of iconic:
- The 2nd byte of the code is the Y value of the left pixel.
- The 4th byte of the code is the Y value of the right pixel.
- The 1st byte of the code is an average of the U value of the pixel to the left of the left pixel, the left pixel, and the right pixel.
- The 3rd byte of the code is analogous for V values.
These averages are weighted arithmetic means where the left pixel is weighted double what the other two pixels are weighted. Not me doing math at 3am π she really said "left pixel is the main character" and honestly? valid.
This format is reminiscent of but rather different from the common YUV 4:2:0 format (aka YUV 420) and the similar YUV 4:4:4, YUV 4:2:2, YUV 4:1:1, YUV 4:1:1s, and YUV 4:1:0. π So don't go assuming they're the same, because they're NOT, and the details matter here.
Quick vibe check on YUV 4:2:0 specifically, since it's the one people always bring up: in YUV 4:2:0, the raster is different for even numbered lines and odd numbered lines. On even numbered lines, there are twice as many bits for Y of each pixel as for U or V. On odd numbered lines, there are the same number of bits for Y as on even numbered lines, but no bits at all for U and V. See? Different. Wild.
Another YUV-based format is YUV4MPEG2, which is a movie format normally used with MJPEGTools π¬. Netpbm does not have converters for this format, but MJPEGTools does. iykyk π«Ά
β¨ OPTIONS β¨
Okay so, plot twist: there are no command line options defined specifically for ppmtoyuv π BUT it recognizes the options common to all programs based on libnetpbm (See Common Options). So you're not left out in the cold, bestie, you get the family options π
β¨ SEE ALSO β¨
yuvtoppm(1)ppmtoeyuv(1)ppmtoyuvsplit(1)ppm(1)pnmtoy4my4mtopnm
β¨ AUTHOR β¨
Marc Boucher marc@PostImage.COM, based on Example Conversion Program, A60/A64 Digital Video Interface Manual, page 69. π
Copyright (C) 1991 by DHD PostImage Inc.
Copyright (C) 1987 by Abekas Video Systems Inc.
β¨ DOCUMENT SOURCE β¨
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/ppmtoyuv.html
and that's the whole page bestie π this one's from netpbm documentation, dated 06 June 2005 β she's vintage, she's immaculate, she's Ppmtoyuv User Manual(1) π β¨ mwah ππ¦
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms