|
Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!
User Commands jpegtran(1)
NAME
jpegtran - lossless transformation of JPEG files
SYNOPSIS
jpegtran [options] [filename]
DESCRIPTION
jpegtran performs various useful transformations of JPEG
files. jpegtran can translate the coded representation from
one variant of JPEG to another, for example from baseline
JPEG to progressive JPEG or vice versa. jpegtran can also
perform some rearrangements of the image data, for example
turning an image from landscape to portrait format by rota-
tion.
jpegtran works by rearranging the compressed data (DCT coef-
ficients), without ever fully decoding the image. Therefore,
jpegtran transformations are lossless: there is no image
degradation at all, which would not be true if you used
djpeg followed by cjpeg to accomplish the same conversion.
However, jpegtran cannot perform lossy operations such as
changing the image quality.
jpegtran reads the named JPEG/JFIF file, or the standard
input if no file is named, and produces a JPEG/JFIF file on
the standard output.
OPTIONS
All options may be abbreviated. For example, -optimize may
be written -opt or -o. Upper and lower case are equivalent.
British spellings are also accepted. For example, -optimise.
The following options are supported:
-copy all Copy all extra markers. This option
preserves miscellaneous markers found in the
source file, such as JFIF thumbnails and
source-application settings. In some files,
these extra markers can be sizable.
-copy comments Copy only comment markers. This option
copies comments from the source file, but
discards any other inessential data. This is
the default.
-copy none Copy no extra markers from the source file.
This option suppresses all comments and
other excess information present in the
SunOS 5.10 Last change: 26 Mar 2004 1
User Commands jpegtran(1)
source file.
-flip horizontalCreate a mirror image horizontally, that is,
from left to right. This is a lossless
transformation.
-flip vertical Create a mirror image vertically, that is,
from top to bottom. This is a lossless
transformation.
-grayscale Force grayscale output. This is not a loss-
less transformation. For more information
about the -grayscale option, see the
Extended Description section.
-maxmemory N Set the limit for the amount of memory to
use in processing large images. N is speci-
fied in thousands of bytes, or in millions
of bytes if "M" is specified with the
number. For example, -max 4m selects 4000000
bytes. If more space is needed, temporary
files are used.
-optimize Optimize the entropy encoding parameters.
For more information about the -optimize
option, see cjpeg(1).
-outfile name Send the output image to the named file,
instead of to the standard output.
-progressive Create a progressive JPEG file. For more
information about the -progressive option,
see cjpeg(1).
-restart N Emit a JPEG restart marker every N MCU rows,
or every N MCU blocks if "B" is specified
SunOS 5.10 Last change: 26 Mar 2004 2
User Commands jpegtran(1)
with the number. For more information about
the -restart option, see cjpeg(1).
-rotate 90 Rotate the image 90 degrees clockwise. This
is a lossless transformation.
-rotate 180 Rotate the image 180 degrees clockwise. This
is a lossless transformation.
-rotate 270 Rotate the image 270 degrees clockwise, or
90 degrees anticlockwise. This is a lossless
transformation.
-scans file Use the scan script provided in the speci-
fied text file.
-transpose Transpose the image, that is, across the
UL-to-LR axis. This is a lossless transfor-
mation. For more information about the
-transpose option, see the Extended Descrip-
tion section.
-transverse Transverse transpose the image, that is,
across the UR-to-LL axis. This is a lossless
transformation.
-trim Drop non-transformable edge blocks. This is
not a lossless transformation. For more
information about the -trim option, see the
Extended Description section.
-verbose Display version information at startup, and
enable debug printout. The -vv option
displays more verbose output than the -v
option. The -vvv option displays the most
verbose output.
SunOS 5.10 Last change: 26 Mar 2004 3
User Commands jpegtran(1)
You can also use -debug to specify this
option.
OPERANDS
The following operands are supported:
filename The name of the JPEG file to be transformed.
EXTENDED DESCRIPTION
If you do not specify one of the following options, you get
a plain baseline-JPEG output file: -optimize, -progressive,
-restart N, -scans file. In such cases, the quality setting
and other settings are determined by the input file.
Lossless Transformations
The transpose transformation has no restrictions as regards
image dimensions. The other transformations operate rather
oddly if the image dimensions are not a multiple of the iMCU
siz, usually 8 or 16 pixels, because they can only transform
complete blocks of DCT coefficient data in the desired way.
The default behavior when transforming an odd-size image is
designed to preserve exact reversibility and mathematical
consistency of the transformation set.
As stated, transpose can flip the entire image area. Hor-
izontal mirroring leaves any partial iMCU column at the
right edge untouched, but is able to flip all rows of the
image. Similarly, vertical mirroring leaves any partial iMCU
row at the bottom edge untouched, but is able to flip all
columns.
The other transforms can be built up as sequences of tran-
spose and flip operations. For consistency, their actions on
edge pixels are defined to be the same as the end result of
the corresponding transpose-and-flip sequence.
Not-Lossless Transformations
You may prefer to discard any untransformable edge pixels
rather than have a strange-looking strip along the right or
bottom edges of a transformed image. To do this, use the
-trim option. Obviously, a transformation with -trim is not
reversible, so strictly speaking jpegtran with this option
is not lossless. Also, the expected mathematical
equivalences between the transformations no longer hold. For
example, -rot 270 -trim trims only the bottom edge, but -rot
90 -trim followed by -rot 180 -trim trims both edges.
SunOS 5.10 Last change: 26 Mar 2004 4
User Commands jpegtran(1)
Another not-strictly-lossless transformation option is
-grayscale. This option discards the chrominance channels if
the input image is YCbCr (that is, a standard color JPEG),
which results in a grayscale JPEG file. The luminance chan-
nel is preserved exactly, so this is a better method of
reducing to grayscale than decompression, conversion, and
recompression. The -grayscale option is particularly useful
for fixing a monochrome picture that was mistakenly encoded
as a color JPEG. In such a case, the space saved by discard-
ing the near-empty chrominance channels is not large, but
the decoding time for a grayscale JPEG is substantially less
than that for a color JPEG.
EXAMPLES
Example 1: Converting a Baseline JPEG File to Progressive
Form
example% jpegtran -progressive test.jpg > testprog.jpg
Example 2: Rotating an Image 90 Degrees Clockwise, Discard-
ing Any Unrotatable Edge Pixels
example% jpegtran rot 90 -trim test.jpg > test90.jpg
ENVIRONMENT VARIABLES
jpegtran uses the following environment variables:
JPEGMEM The value of this environment vari-
able, if set, is the default memory
limit. The value is specified as
described for the -maxmemory option.
JPEGMEM overrides the default value
specified when the program was com-
piled, and is in turn overridden by
an explicit -maxmemory option.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWjpg |
|_____________________________|_____________________________|
| Interface stability | External |
|_____________________________|_____________________________|
SunOS 5.10 Last change: 26 Mar 2004 5
User Commands jpegtran(1)
SEE ALSO
Wallace, Gregory K., The JPEG Still Picture Compression
Standard Communications of the ACM, April 1991 (vol. 34, no.
4), pp. 30-44.
cjpeg(1), djpeg(1), rdjpgcom(1), wrjpgcom(1)
NOTES
Arithmetic coding is not supported.
The entire image is read into memory and then written out
again, even in cases where this is not really necessary.
Expect swapping on large images, especially when using the
more complex transform options.
This man page was originally written by the Independent JPEG
Group. Updated by Breda McColgan, Sun Microsystems Inc.,
2004.
SunOS 5.10 Last change: 26 Mar 2004 6
Man(1) output converted with
man2html and wrapped by fishsponge
This page was generated on Wed Sep 12 11:24:59 GMT 2007
|
Your favourite pages:
No pages logged yet. Trying to save cookie... Top 10 most popular pages:
sqlite3 man page (5059 hits) (openSUSE 10.2)
adv_cap_autoneg man page (4731 hits) (Solaris 10 11_06)
CPAN man page (4452 hits) (Suse Linux 10.1)
ssh man page (4241 hits) (Suse Linux 10.1)
svn man page (4118 hits) (FreeBSD 6.2)
startproc man page (2159 hits) (Suse Linux 10.1)
ssh-socks5-proxy-connect man page (2104 hits) (Solaris 10 11_06)
netcat man page (2088 hits) (Suse Linux 10.1)
signal man page (1950 hits) (Suse Linux 10.1)
pprosetup man page (1949 hits) (Solaris 10 11_06)
|