Changes since the 28nov1999 version: Clangification - widespread but minor edits to allow use of the new clang C compiler. Added pnmquadrilateral. Changes since the 10dec1991 patch version: Split pm_close() into pm_closer() and pm_closew(), because fflush()ing an input file doesn't work. Sped up reading raw PGM and PPM files. (suggested by Burkhard Neidecker-Lutz) Added M_PI to pgmcrater, not everybody has it in math.h. (Anthony A. Datri) Added JFIF to the magic file, and added calls to djpeg to anytopnm even though djpeg is in a separate package. Some minor (but verbose) enhancements to anytopnm. Added -nomap flag to pnmtorast and pnmtotiff, to skip trying to write a colormapped file. Added missing warning message to ppmtotga. Converted pbmtoplot to go line-by-line. Added short-circuit to ppmquant when quantization is not necessary. Made ppmquant go line-by-line when the -map option is used. A couple of other minor changes to ppmquant. Added signal-trapping to pnmsmooth and pnmmargin. Added check for "bogus clear code" in giftoppm. Bugfixes to pgmnorm, pnmrotate. Optimization to pnmgamma. (Arthur David Olson) Substantial speedup to ppmquant by caching squares. (Jim Hanko) Another substantial speedup to ppmquant by re-doing color searching. (James (J.H.) Brunner) Re-implemented the color-mapping part of ppmquant to use a recombinant array instead of a hash table - huge speedup for -floyd case, which is now good enough to make the default. Added -writemap flag to ppmquant. Fixed typo in pgmtoppm usage message. Minor portability fixes to macptopbm, sputoppm, and a typo in libpbm.3. (James W. Birdsall) Changed email address. Added a font flag to pnmindex. Changed pbmtoxbm to generate unsigned char arrays, and fixed xbmtopbm to accept either kind. Added -2x4 mode to pbmtoascii. Slight changes to tifftopnm for libtiff v3.0. Bug fix to the ppmtogif compression code - GIF files were correct but needlessly large. The same bug appears in many LZW compressors. (Tom Lane) Fixed pnmconvol to convolve all the way to the edges, by replicating the edge pixels. Portability enhancements to xwdtopnm courtesy of Wes Barris. Added fonts, colormaps, convolkerns subdirectories. Major file re-organization. No more pbm|pgm|ppm|pnm subdirectories; appls|lib|inc|extras subdirs instead. No more Imakefiles. Compat files go away. Config files for easy adding of new filters. Added pnmstega pnmdestega pcdtoppm pnmdissect pnmfold pnmroll pnmshadow pnmframe. Added -sine flag to pgmramp - idea from Gerald C. Combs. Fix to pnmtotiff for grayscale PPM files, from Stefan Scherer. Fix to pnmtotiff for maxval > 255, from Ingo Wilken. Replaced giftoppm with netpbm's giftopnm, adding in Arthur David Olson's "bogus clear code" fix. Transparency and colormap additions to ppmtogif, by Marcel Wijkstra. Merged in the netpbm versions of: fitstopgm pgmtofits pgmtexture ppmdither ppmtosixel ilbm.h xpmtoppm ppmtoxpm pnmarith gemtopbm ppmhist sldtoppm ilbmtoppm pbmtogem pbmtolj pgmtopbm picttoppm ppmtoilbm. Added new programs from netpbm: ppmntsc ppmdim ppmshift ppmspread bmptoppm ppmtobmp ppmtomitsu sgitopnm pnmtosgi bioradtopgm pbmto4425 pbmtoepsi pbmtoln03 pnmtosir sirtopnm ppmtopjxl spottopgm zeisstopnm pbmtolps pnmtoddif xvminitoppm ppmtoyuvsplit yuvsplittoppm pbmclean pgmnoise pnmalias pnmcomp pnmnlfilt ppmbrighten ppmchange ppmdist ppm3d ppmflash ppmmix ppmnorm. Added lum.h from netpbm. And from netpbm to the extras directory: pbmpscale pbmtopgm pgmkernel pktopbm pbmtopk pnmhistmap pnmpad pnmtoraw asciitopgm. Promoted some filters: ppmntsc to pnmntsc ppmdim to pnmdim ppmshift to pnmshift ppmspread to pnmspread ppmflash to pnmflash ppmtogif to pnmtogif Got rid of the ARGS macro, and STDC ifdefs - now STDC is assumed. Got rid of the PBMPLUS_RAWBITS option - now it's always on. Got rid of the PPM_PACKCOLORS option. Added prototypes to all remaining routines in libpnm. Changed all main() routines to be type int instead of void, and be prototyped. Added prototypes to most routines in the applications. Changes since the 30oct1991 patch version: Fixed uninitialized variable in ppmtotga. (John Walker) Added pgmcrater, ppmforge, ppmtoacad, sldtoppm. (John Walker) Slight change to the p?mmerge.c front-ends to allow for main programs that return instead of exitting. Minor clarifications to the pnmconvol man page. Fixed xwdtopnm to read some 16-bit True/Direct files. (David Elliott) Fixed uninitialized variables in pnmtotiff. (Larry Rosenstein, Bayles Holt) Added a couple of checks for \r while reading whitespace. (Larry Rosenstein) Removed all the BROKENPUTC stuff. Now we ignore all return values from putc(), and check ferror() in pm_close(). Added pm_close() calls to many of the filters. Fixed pnmdepth to check for too-large newmaxvals. Improved rounding in pnmdepth and PPM_DEPTH macro. (Tom Lane) Minor fix to ppmtouil. (Mohsen Banan) Added new Imakefiles. (Rainer Klute) Changes since the 05oct1991 X11R5 contrib tape version: Fixed minor SysV config error in pbmplus.h. (Tom Lane) Fixed tifftopnm so that BITSPERSAMPLE and SAMPLESPERPIXEL default correctly. Fixed possible bug in tgatoppm line-interleaving code. (Arthur David Olson) Fixed tifftopnm so that colormapped files are read correctly. (PauL Drews, Mike Wade) Corrected use of DefaultRGBDatabase / RGB_DB for imake sites. (Randal L. Schwartz) Bugfix to pnmtops color PostScript in -rle mode. (Angus Duggan) Added auto-turning to pnmtops. Added run-length encoding to ppmtotga. Space optimization to pgmoil. Changes since the 27sep1991 comp.sources.misc distribution: Fixed spelling error in giftoppm. Fixed ppmrelief to not shrink the image by 2 rows and columns. Minor fix to pgmramp. Fixed off-by-one error in pnmtoxwd. Man page fix for pnmgamma. (Arthur David Olson) Converted ANSI trigraphs in ppmtosixel into good old octal. (Jeff Glover) Fix to 24/32 bit case in rasttopnm. (Behr de Ruiter) Float/double portability fix to libppm4. (Bruce Holmer, Ronald Khoo) Fixed typo in compat.ksh. (Larry Virden) Fixed int/short incompatibility in tifftopnm. (Salik Rafiq) Changes during the extended beta test period, starting on 15jan1991: Lots of fixes from: Anthony A. Datri, Arthur David Olson, David Brooks, David Elliott, Doug Claar, Duncan Sinclair, Francois Pinard, Gerard Leurs, Jim Hanko, Ken Laprade, Klaus U. Schallhorn, Markus Bolz, Mike Hench, Philip Gladstone, R C Smith, Selden E. Ball, Jr., Stephen Uitti, Steve Allen, Tom Lane, update.kpj-jaakkola@athena.dsv.su.se, Charles Karney, Unmesh Agarwala, Ed Pendzik, Juha Sarlin, Tom Tulinsky, Phillip Smith, Lai-King Mau, David Koblas, Mark Donovan. Added a global -version flag. Added bunches of statics and prototypes. Now compiles with zero warnings under gcc -ansi -pedantic. Changed #ifdef __STDC__ to #if __STDC__, since some non-compliant compilers define it as 0. Changed pm_message and pm_error to be varargs routines. Added a portable version of vfprintf for those systems which don't have it. Removed the option of not compiling the pgm and ppm parts. Very few people used it, and it added amazing complexity to the pnm programs, turning them into maintenance nightmares. Merged pbmpaste into pnmpaste. Merged pgmtops and ppmtops into pnmtops. Added auto-scaling and dpi / page size flags to pnmtops. Changed the interpretation of bits in pbmlife to conform with other tools. Changed xwdtopnm to ignore the pixel number in the xwd color structure. Added a -pseudodepth flag to pnmtoxwd. Updated tifftopnm for libtiff 2.4. Added many option flags to pnmtotiff. (J.T. Conklin) Added support for X11R5's new color specifiers rgb: and rgbi:. Added pgmtexture. (James Darrell McCauley) Added ppmtopj, pjtoppm, and ppmdither. (Christos Zoulas) Added ppmtotga. (Mark Shand) Added ppmtosixel. (Rick Vinci) Added pbmtoatk and atktopbm. (Bill Janssen) Added ppmtoyuv and yuvtoppm. (Marc Boucher) Fixes to picttoppm. (George Phillips) Added 24-bit support to ilbmtoppm. (Mark Thompson) Changes since the X.V11R4 / comp.sources.misc distribution of 22nov1989: Added pgmramp, pgmedge, pgmtoppm, rgb3toppm, ppmtoxpm, pnmgamma, ximtoppm, pgmtofs, picttoppm, ppmtopict, ppmquantall, anytopnm, pi1toppm, ppmtopi1, sputoppm, spctoppm, pbmto10x, ppmtoicr, ppmmake, xpmtoppm, ppmtopuzz, ppmtouil, ybmtopbm, pbmtoybm, lispmtopgm, pgmtolispm, pbmtogem, pi3topbm, pbmtopi3, pbmtoepson, pbmtoplot, pbmtozinc, pbmtext, pnmnoraw, pnmmargin, pnmfile, pnmindex, ppmtorgb3, gouldtoppm, pgmbentley, pgmoil, ppmrelief, pnmtotiff, ppmtopcx. Merged some filters: rasttopbm and rasttoppm into rasttopnm; pbmtorast and ppmtorast into pnmtorast; xwdtopbm and xwdtoppm into xwdtopnm; pbmtoxwd and ppmtoxwd into pnmtoxwd. Promoted some filters: pcxtopbm to pcxtoppm; ppmarith to pnmarith; ppmconvol to pnmconvol; ppmcscale to pnmdepth; ppmrotate to pnmrotate; ppmscale to pnmscale; ppmshear to pnmshear; ppmsmooth to pnmsmooth; tifftopgm to tifftopnm - new version based on Sam Leffler's libtiff. Bugfixes to pbmtoicon, ppmtops. The Makefiles now have a "merge" option. All flags are now case-insensitive. Added $(MAKE) stuff to Makefile. Changed pnmsmooth from a csh script to a sh script. Made macro use in pbmtox10bm and pbmtoxbm more portable. Moved compataliases to compat.csh, and added compat.ksh. Made ppmtoilbm less Amiga-specific. Added -headerskip and -rowskip flags to rawtopgm. Enhanced rasttopnm to interpret 8-bit rasters with no colormap as grayscale. Changed sscanf %g to %f - some systems can't handle %g on input. Added -expand flag to pbmmask. Speedup to pnmflip - don't buffer if possible. Added color-name-to-value routine to ppm - uses X11's rgb.txt if present. Updated Imakefile support to reflect X.V11R4. Removed picttopbm. Improved pnmcut argument syntax so that negative coords work like pnmpaste. Added "magic" file, for use with the "file" program. 40% speedup for pgmnorm from Robert Stockton (rgs@cs.cmu.edu). Fixed long-standing bug involving colormaps on SPARCstations when compiled with gcc -- had to do with passing structs by value. Removed the -x flag from pnmtorast -- it's not really needed. Fixed subtle bug in the pnm reading code that caused pnmcat to blow it on images that differed greatly in width or height. New version of giftoppm that handles the GIF89a standard, and doesn't use fseek. Fixed fitstopgm to handle three-axis images, such as the Hubble pix. Xwdtopnm and pnmtoxwd finally handle byte-order properly. Added -xysize flag to pnmscale. Added conditional ANSI function prototypes to library routines. Added -noantialias flag to pnmrotate and pnmshear. Removed the TIPS file. No one ever sent in any new tips, so I just moved the few I had into the relevant man pages. That's probably where they belonged in the first place. Added justification flags to pnmcat. Added -map flag to ppmquant - user-specifiable colormap. Also, the Floyd-Steinberg error diffusion finally works right. Added -map flag to pgmtoppm. Added DirectColor support to xwdtopnm and pnmtoxwd. Speedup to pgmtolj from Arthur David Olson: avoid sending whitespace. Fix to pbmtogo from Bo Thide': 2D compression now works. Patch 1 to the X.V11R4 / comp.sources.misc distribution of 22nov1989: Fixed bug in pgmtops -rle. Changes since the alt.sources distribution of 13sep1989: Small corrections to ppmtorast, pgmtops. Moved pbm/tifftopbm to pgm/tifftopgm - it now handles grayscale TIFF files. Fixed tifftopgm to handle non-native byte order. Changes to tifftopgm to handle bogus AppleScan TIFF files, to have better command syntax, and to use stdio. Optimizations to xbmtopbm, pbmtoxbm, and pbmtox10bm, courtesy of Juha Sarlin, to make them go about three times as fast. Optimization to pgmtops and ppmtops to make them go three times as fast. Optimization to pnmcrop. Added PBMPLUS_BROKENPUTC defines in pbmplus.h to handle systems (such as ULTRIX) which have broken putc() macros. Rewrote ppmscale, pnmcat, and pgmhist to operate line-by-line, instead of reading in the whole image. Rewrote pnmflip to keep only one copy of the image in memory. Added pgmtofits, courtesy of Wilson H. Bent, plus bugfixes to fitstopgm and a patch to giftoppm to handle black&white GIF files. Added picttopbm and rawtopgm. Fixes to xwdtoppm and ppmtoxwd so they compile with SunOS cc as well as gcc. Another small change to ppmtoxwd having to do with colormap size. Changed macptopbm's -headersize flag to be -extraskip. Changed tgatoppm to read color values as BGRA instead of ARGB; the Targa documentation is apparently wrong about the order. Some changes to the Makefiles, partially to work around bugs in gnumake. Got g3topbm working, and added pbmtog3, courtesy of Paul Haeberli. Added some pixrect work-alike code so that rasttopbm, pbmtorast, rasttoppm, and ppmtorast can be used on non-Sun systems. This also provides a final solution to the persistent byte- and bit-order problems on 386's. Moved the SYSV-checking #ifdefs to *after* the include of pbm.h, which defines SYSV. Made all the #else's and #endif's ANSI-compliant. Added manual pages for libpbm, libpgm, libppm, and libpnm, courtesy of Tony Hansen. Changed man page installation so that pages from different sections can go in different directories. Fixed Imakefiles. Changes since the expo.lcs.mit.edu FTP distribution of 06sep1989: Added #ifdefs to pnm/libpnm3.c to allow the PBM-PNM-only configuration. Small corrections to TIPS, pnm/Makefile, pnm/Imakefile, ppm/ppmrotate.1, ppm/ppmshear.1, ppm/ppmtoilbm.c, pbm/xwdtopbm.c, ppm/xwdtoppm.c, ppm/ppmtoxwd.c, ppm/ppmtoxwd.1, pbm/x11wd.h. Changes since the comp.sources.misc distribution of 31oct1988: Added pbmreduce, pbmlife, pbmmask, and pbmupc. Added gemtopbm, tifftopbm, pcxtopbm, pbmtogo, mgrtopbm, pbmtomgr, cmuwmtopbm, pbmtocmuwm, g3topbm, and pbmtobg. Minor bugfix to pbmtolj. Slight restructuring of most of the programs to use vastly less memory. Various other minor optimizations. Fixed pbmtorast and rasttopbm to handle byte-swapped big-endian 386 boxes. Slight changes to argument syntax of pbmcrop, pbmmake, pbmreduce. Moved to the new PGM package: pbmtops (which now produces Conforming PS). Moved to the new PPM package: giftopbm. Moved to the new PNM package: pbmcrop pbmcut pbmenlarge pbminvert. Consolidated into a single pnmflip tool: pbmfliplr pbmfliptb pbmtrnspos. Consolidated into a single pnmcat tool: pbmcatlr pbmcattb. Added compataliases script for upward compatability with changed tools. Removed xxxtopbm. Added a -headersize flag to macptopbm, to help get around annoying problems in MacPaint file format. Added the RAWBITS compilation-time option, to use a more compact and much faster (but less portable) external format. Removed the CBM format - use compress(1) and / or RAWBITS instead. Pbmpaste (and the new pnmpaste) now accepts negative x and y coords, which are interpreted relative to the right and bottom sides. Changed all programs to accept a "-" file argument as meaning standard input. Removed pbmtox10wd, since it was never very useful (X10 doesn't have xwud). Added Imakefiles, for X11 types to use. Changes since the X.V11R3 distribution of 31aug1988: The cbm format has been revised to support run-length encoding. Pbmtops now does run-length encoding. Major changes since the X.V11R2 distribution of 28mar1988: The pbm format now has a "magic number". New conversion filters: brushtopbm, giftopbm, pbmtolj, pbmtomacp, pbmtoxwd, and pbmtox10wd. Icontopbm converter has a better parser -- it knows to skip over any extraneous comments at the beginning of the icon file. Pbmtops generates a different PostScript wrapper program -- it should handle huge bitmaps better. Xwdtopbm now handles byte-swapping correctly. Pbmmake takes a flag to specify the color of the new bitmap. Pbmpaste now implements 'or', 'and', and 'xor' operations as well as the default 'replace'.