This document specifies advanced techniques for the JPEG compression algorithm.
The purpose of this document is to describe the JPEG Advanced Single-Scan Progressive/Sequential JPEG Compressor, which is intended to produce nearly lossless JPEG files (within the recommended proportions of actual to maximum theoretical compression).
The rate-distortion performance of this compressor is superior to the baseline JPEG compressor for a wide range of inputs. The jpegtran program is a useful utility for examining the behavior of this compressor.
The JPEG compression method described here is compatible with previous versions of this standard, except for the introduction of the "progressive" option in Annex D. This allows a JPEG file to be progressively scanned, so that the file consists of several segments that can each be independently compressed. Each "component" of the JPEG file is referred to as a "segment".
The JPEG standard also supports the use of so-called "advanced color spaces" (PNG doesn't support these, so we will ignore those here). These color spaces allow for much better color fidelity in the compressed image, but are only supported with sequential JPEG and only by special purpose image decoders. Color spaces include Extended RGB (aka GRGB), Extended HSV (aka HSV), and also RGB-alpha. Since the baseline JPEG does not support these color spaces, the GRGB and RGB-alpha extensions are ignored for the baseline JPEG.
Note that a set of references is available for the JPEG encoding defined in this document. These references are available on the JPEG, jpegtran, and rdjpgcom Web sites.
The references for the JPEG encoding defined in this document are listed below:
(1) The baseline JDK 1.0.2 IJG code, jfdctfst.c.
(2) The baseline JDK 1.1.1 IJG code, jfdctint.c.
(3) The progressive JPEG code from the libjpeg-turbo project. The functions jpeg_write_coefficients, jpeg_start_compress, jpeg_write_scanlines, and jpeg_finish_compress are defined in jcapimin.c, jcapistd.c, jcmarker.c, jcmaster.c, jcomapi.c, jcparam.c, jdatadst.c, jcinit.c, and jcmaster.h.
(4) A progressive JPEG
pjpegtran is a small library that allows you to transcode JPEG files. Currently supported scale factors are M/N with all M from 1 to 16, where N is the source DCT size, which is 8 for baseline JPEG. If the /N part is omitted, then M specifies the DCT scaled size to be applied on the given input.
For baseline JPEG this is equivalent to M/8 scaling, since the source DCT size for baseline JPEG is 8. CAUTION: An implementation of the JPEG SmartScale extension is required for this feature. SmartScale enabled JPEG is not yet widely implemented, so many decoders will be unable to view a SmartScale extended JPEG file at all.
If you want to scale an image, this would be the library to use. It allows you to scale images in the JPEG standard using the full range of scale factors from 1 to 16, where 1 is equivalent to no scaling and 16 is equivalent to an 8x8 pixel matrix.
This library is a work in progress but it is already used in the PHP library by the name "phpthumb"
There is an example:
scaleImage(1,4); // 4 is the number of output images
//Output the results
in the example you will find all the additional parameters:
scaleImage(1,4,9,3); // 9 is the output ratio
//Output the results
The above example is for the full range of scale factors, 1 to 16.
If you want to a specific factor use the optional scaleFactor param.
scaleImage(1,4,9,3,5); // 5 is the output ratio
//Output the results
I think it is included in ImageMagick. I found it in the docs.
ImageMagick has a scaleImage() method that allows you to scale a JPEG image up to 16 times larger. Here is a simple example:
#! /usr/bin/env perl
# Scale the image up to 16 times larger
my $im = new Image::Magick();
$im->scaleImage(0, -1, 0, 16);
jpegtran is a small C library that can translate a compressed JPEG file from one of the almost-universal variants (baseline, progressive, or lossless JFIF JPEG) to another arbitrary format. It is intended to be convenient for users of JPEG-embedded data to perform common transformations from one standard to another, whether it is for system-to-system communication or in a client-server scenario where the transformation is part of the job of the server. Users of the library would normally be working with JPEG image data, such as when composing or editing images, rather than with the transformed data itself. This is in contrast to the JPEG Lossless codec, which does permit transcoding between lossless and compressed formats.
jpegtran supports lossless and lossy compression as well as progressive decompression. It can also scale, rotate, flip, crop, and general-purpose transform an image. It is intended for use in situations, such as those, where it is necessary to decode a JPEG that has been transformed by some other process (such as a browser modifying a JPEG served by a server), possibly because the other process is either incompatible with the library's capabilities or has complete control over the output format. The library's capabilities are similar to the widely used libjpeg, except that the library was designed specifically to support transcoding between different JPEG standards. jpegtran's scale factors (M, DCT scaled size) can be scaled arbitrarily as well; the library can support arbitrary input and output sizes.
jpegtran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
jpegtran is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
``jpegtran --decode... -s M/N -b -srate N/M'' will scale the specified JPEG file to the new dimensions. Scaling is horizontal only, the vertical size of the source image will not be altered.
The scale factor of the source image, which is currently stored in ``sar``, can be changed with the ``-sar N'' option. JPEG images that have the SOF0 marker or a DHT marker will be considered scalable and will be converted to the new size. The conversion is done on the fly if the source image is read from a file, otherwise the conversion is postponed until the file is closed.
If JPEG is not the default format, then ``jpegtran -s N'' is used to scale the source image.
jpegtran [switches] [inputfile]
jpegtran [switches] -outfile outputfile [inputfile]
jpegtran [switches] -outfile outputfile -strip [inputfile]
jpegtran [switches] -outfile outputfile -write_jfif [inputfile]
jpegtran [switches] -outfile outputfile -rgb [inputfile]
jpegtran [switches] -outfile outputfile -write_exif [inputfile]
jpegtran [switches] -outfile outputfile -compress [Z] [inputfile]
jpegtran [switches] -targa inputfile
jpegtran [switches] -self_contained [inputfile]
jpegtran [switches] -optimize [none/fast/best] [inputfile]
jpegtran [switches] -progressive [inputfile]
jpegtran [switches] -arithmetic [none/fast/best] [inputfile]
jpegtran [switches] -restart [N] [inputfile]
jpegtran [switches] -max_memory [number_of_MB]
jpegtran [switches] -outfile outputfile -sample_max [N] [inputfile]
jpegtran [switches] -bmp [inputfile.bmp]
jpegtran [switches] -rgb [inputfile.rgb]
jpegtran [switches] [inputfile] [outputfile]
Input files can be either JPEG, JFIF, or DHT files. If no input file is specified, then the standard input is used. Standard input can be a file name, a file pointer returned by fopen(), or a handle returned by popen().
The -rgb switch creates an RGB (
Bodacious Bevy Video Loops:
20+GB free space
Vista, Win7, Win8, 10 ( 32-bit / 64-bit ), 64-bit
Internet Explorer 9 or higher
Older computers may experience slight frame drops during playback.
Stuttering during playback:
Some computers and browsers will experience a little stuttering during playback, try running the Loops through another browser or computer if this occurs.
Bodacious Bevy Videos:
Tithi Timer Hindu CalendarTala Web Email Extractor (TWEE) Express EditionEuro KeyTrafficMonDouble cheeseburger