Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
jpegtopnm(1)
Edit
PageHistory
Diff
Info
LikePages
JPEGTOPNM !!!JPEGTOPNM NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES HINTS ENVIRONMENT SEE ALSO LIMITATIONS AUTHOR ---- !!NAME jpegtopnm - convert JPEG/JFIF file to portable pixmap or graymap !!SYNOPSIS __jpegtopnm__ [[__-dct__ {__int__|__fast__|__float__}] [[__-nosmooth__] [[__-maxmemory__ ''N''] [[{__-adobe__|__-notadobe__}] [[__-comments__] [[__-dumpexif__] [[__-exif=__''filespec''] [[__-verbose__] [[__-tracelevel__ ''N''] [[ ''filename'' ] All options may be abbreviated to their shortest unique prefix. !!DESCRIPTION __jpegtopnm__ converts the named JFIF file, or the standard input if no file is named to a PPM or PGM image file on the standard output. If the JFIF file is of the grayscale variety, __jpegtopnm__ generates a PGM (Portable Graymap) file. Otherwise, it generates a PPM (Portable Pixmap) file. __jpegtopnm__ uses the Independent JPEG Group's JPEG library to interpret the input file. See __http://www.ijg.org__ for information on the library. EXIF is an image format that is a subformat of JFIF (to wit, a JFIF file that contains an EXIF header as an APP1 marker). __jpegtopnm__ handles EXIF. JFIF files can have either 8 bits per sample or 12 bits per sample. The 8 bit variety is by far the most common. There are two versions of the IJG JPEG library. One reads only 8 bit files and the other reads only 12 bit files. You must link the appropriate one of these libraries with __jpegtopnm__. Ordinarily, this means the library is in your shared library search path when you run __jpegtopnm__. __jpegtopnm__ generates output with either one byte or two bytes per sample depending on whether the JFIF input has either 8 bits or 12 bits per sample. You can use __pnmdepth__ to reduce a two-byte-per-sample file to a one-byte-per-sample file if you need to. If the JFIF file uses the CMYK or YCCK color space, the input does not actually contain enough information to know what color each pixel is. To know what color a pixel is, one would have to know the properties of the inks to which the color space refers. __jpegtopnm__ interprets the colors using the common transformation which assumes all the inks are simply subtractive and linear. !!OPTIONS The options are only for advanced users: __-dct int__ Use integer DCT method (default). __-dct fast__ Use fast integer DCT (less accurate). __-dct float__ Use floating-point DCT method. The float method is very slightly more accurate than the int method, but is much slower unless your machine has very fast floating-point hardware. Also note that results of the floating-point method may vary slightly across machines, while the integer methods should give the same results everywhere. The fast integer method is much less accurate than the other two. __-nosmooth__ Use a faster, lower-quality upsampling routine. __-maxmemory__ ''N'' Set limit on the amount of memory __jpegtopnm__ uses in processing large images. Value is in thousands of bytes, or millions of bytes if __-maxmemory 4m__ selects 4000000 bytes. If __jpegtopnm__ needs more space, it uses temporary files. __-adobe__ __-notadobe__ There are two variations on the CMYK (and likewise YCCK) color space that may be used in the JFIF input. In the normal one, a zero value for a color components indicates absence of ink. In the other, a zero value means the maximum ink coverage. The latter is used by Adobe Photoshop when it creates a bare JFIF output file (but not when it creates JFIF output as part of Encapsulated Postscript output). These options tell __jpegtopnm__ which version of the CMYK or YCCK color space the image uses. If you specify neither, __jpegtopnm__ tries to figure it out on its own. In the present version, it doesn't try very hard at all: It just assumes the Photoshop version, since Photoshop and its emulators seem to be the main source of CMYK and YCCK images. But with experience of use, future versions might be more sophisticated. If the JFIF image does not indicate that it is CMYK or YCCK, these options have no effect. If you don't use the right one of these options, the symptom is output that looks like a negative. __-dumpexif__ Print the interpreted contents of any Exif header in the input file to the Standard Error file. Similar to the program __jhead__ (not part of the Netpbm package). __-exif=__''filespec'' Extract the contents of the EXIF header from the input image and write it to the file ''filespec''. ''filespec'' = __-__ means write it to Standard Output. In this case, __jpegtopnm__ does not output the converted image at all. __jpegtopnm__ writes the contents of the EXIF header byte-for-byte, starting with the two byte length field (which length includes those two bytes). You can use this file as input to __ppmtojpeg__ to insert an identical EXIF header into a new JFIF image. If there is no EXIF header, __jpegtopnm__ writes two bytes of binary zero and nothing else. An EXIF header takes the form of a JFIF APP1 marker. Only the first such marker within the JFIF header counts. __-comments__ Print any comments in the input file to the Standard Error file. __-verbose__ Print details about the conversion to the Standard Error file. __-tracelevel__ ''n'' Turn on the JPEG library's trace messages to the Standard Error file. A higher value of ''n'' gets more trace information. __-verbose__ implies a trace level of at least 1. !!EXAMPLES This example converts the color JFIF file foo.jpg to a PPM file named foo.ppm: __jpegtopnm foo.jpg __ !!HINTS You can use __ppmquant__ to color quantize the result, i.e. to reduce the number of distinct colors in the image. In fact, you may have to if you want to convert the PPM file to certain other formats. __ppmdither__ Does a more sophisticated quantization. Use __pnmscale__ to change the dimensions of the resulting image. Use __ppmtopgm__ to convert a color JFIF file to a grayscale PGM file. You can easily use these converters together. E.g.: __jpegtopnm foo.jpg | ppmtopgm | pnmscale .25 __-dct fast__ and/or __-nosmooth__ gain speed at a small sacrifice in quality. If you are fortunate enough to have very fast floating point hardware, __-dct float__ may be even faster than __-dct fast__. But on most machines __-dct float__ is slower than __-dct int__; in this case it is not worth using, because its theoretical accuracy advantage is too small to be significant in practice. Another program, __djpeg__, is similar. __djpeg__ is maintained by the Independent JPEG Group and packaged with the JPEG library which __jpegtopnm__ uses for all its JPEG work. Because of that, you may expect it to exploit more current JPEG features. Also, since you have to have the library to run __jpegtopnm__, but not vice versa, __cjpeg__ may be more commonly available. On the other hand, __djpeg__ does not use the NetPBM libraries to generate its output, as all the NetPBM tools such as __jpegtopnm__ do. This means it is less likely to be consistent with all the other programs that deal with the NetPBM formats. Also, the command syntax of __jpegtopnm__ is consistent with that of the other Netpbm tools, unlike __djpeg__. !!ENVIRONMENT __JPEGMEM__ If this environment variable is set, its value is the default memory limit. The value is specified as described for the __-maxmemory__ option. An explicit __-maxmemory__ option overrides any __JPEGMEM__. !!SEE ALSO ppm(5), pgm(5), ppmtojpeg(1), ppmquant(1), pnmscale(1), ppmtopgm(1), ppmdither(1), pnmdepth(1),__ djpeg__(1), cjpeg(1), jpegtran(1), rdjpgcom(1), wrjpgcom(1), jhead(1) Wallace, Gregory K. !!LIMITATIONS Arithmetic coding is not supported for legal reasons. The program could be much faster. !!AUTHOR __jpegtopnm__ and this man page were derived in large part from __djpeg__, by the Independent JPEG Group. The program is otherwise by Bryan Henderson on March 19, 2000. ----
3 pages link to
jpegtopnm(1)
:
Man1j
pnmtojpeg(1)
ppmtojpeg(1)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.