Jpegpixi
JPEG Pixel Interpolator
What is it?
‘Jpegpixi’ is short for ‘JPEG Pixel Interpolator’. The intent of the program is to interpolate pixels (single pixels, dots, stripes) in JPEG images. This is useful to correct images from a digital camera with CCD defects. For example, if one pixel is always bright green, this pixel can be interpolated with jpegpixi.
Jpegpixi is unique in that it tries to preserve the quality of the JPEG image as much as possible. Usual graphics programs decode JPEG images when they are loaded, and re-encode them when they are saved, which results in an overall loss of quality. Jpegpixi, on the other hand, only decodes the DCT blocks (typically 8×8, 16×8, or 16×16 pixel areas) which contain pixels to be interpolated, and when it re-encodes them, it uses exactly the same parameters with which the image has originally been encoded. These blocks are therefore only minimally disturbed, and other blocks remain pixel-by-pixel identical to the original image.
Jpegpixi is a command line utility. Its messages and the manual pages are available in four languages:
- English,
- Finnish (thanks to
Jarno Elonen), - French (thanks to
Stephan Peccini), - German.
Jpegpixi is
Free Software,
released under the GNU General Public License.
[ Top of Page ]
Download
To build the program, you need
version 6b of the JPEG library by the
Independent JPEG Group.
- Version 1.1.1 (20-Nov-2005, latest release):
- Source: jpegpixi-1.1.1.tar.gz (152 KB)
- Digital signature: jpegpixi-1.1.1.tar.gz.sig
- New in this version:
- Fixed typo in English jpegpixi manual page.
- Updated postal address of the Free Software Foundation.
- Version 1.1.0 (01-Jun-2005):
- Source: jpegpixi-1.1.0.tar.gz (152 KB)
- Digital signature: jpegpixi-1.1.0.tar.gz.sig
- New in this version:
- From now on, I will sign releases. Information on how to obtain and verify my key is available on the contact information page.
- In addition to hot pixels in an otherwise black image, the jpeghotp program can now also find dead pixels in an otherwise white image.
- The programms fail gracefully if the locale cannot be set.
Debian packages are also available.
[ Top of Page ]
Bug Reporting
Bug reports should be mailed to <martin@zero-based.org>. Please include all relevant information. If jpegpixi fails to build, you should include the file config.log, which is created during configuration of the package. If jpegpixi crashes or behaves incorrectly at run time, please state the exact command you have used to invoke it, and include the original as well as the newly created image file.
Of course, you can also suggest new features you would like to have, or just tell me what you think of jpegpixi.
![]()
[ Top of Page ]
Frequently Asked Questions
The following questions are answered in this section:
- 1. How do I find out the coordinates of a pixel?
- 2. Is jpegpixi idempotent?
- 3. Does jpegpixi increase the file size?
- 4. What interpolation methods does jpegpixi support?
- 5. Can jpegpixi read progressive JPEG files?
1. How do I find out the coordinates of a pixel?
Any graphics program should be able to help you with this. I personally use
ImageMagick's
display program. The middle mouse button shows the coordinates in a zoomed window.
Alternatively, the jpeghotp program (which is part of the jpegpixi distribution) finds hot pixel blocks in an otherwise black JPEG image. To obtain an image suitable for jpeghotp, take a picture with your digital camera in total darkness or with covered lens.
2. Is jpegpixi idempotent?
Jpegpixi is idempotent (which means that if you run it twice with the same options, using the output of the first run as the input of the second, the image is not changed) for images compressed with a very high quality setting. For all other images, there is an inevitable quality loss in the blocks which contain the pixels to be interpolated. Of course, other blocks are not affected.
3. Does jpegpixi increase the file size?
Usually the file size is slightly decreased, which is not surprising, since the data can be better
compressed after the interpolation. ![]()
4. What interpolation methods does jpegpixi support?
It supports averaging adjacent pixels; linear, quadratic, and cubic interpolation in one dimension; and bilinear, biquadratic, and bicubic interpolation in two dimensions.
The command jpegpixi --help shows how to invoke a specific method.
5. Can jpegpixi read progressive JPEG files?
Yes, but it always writes baseline JPEG files.
[ Top of Page ]
Examples
Example 1
| Before | After |
|---|---|
![]() example1-before.jpg (2362 B) |
![]() example1-after.jpg (1720 B) |
In this (somewhat artificial) example, the command
jpegpixi example1-before.jpg example1-after.jpg 22,22 67,22 22,67 67,67
has been used to remove the four red pixels. This has also decreased the file size by more than 27%.
Example 2
| Before | After |
|---|---|
![]() example2-before.jpg (11660 B) |
![]() example2-after.jpg (10567 B) |
This (again artificial) example demonstrates the differences between 2-dimensional, horizontal 1-dimensional and vertical 1-dimensional interpolation. The command
jpegpixi -m3 example2-before.jpg example2-after.jpg 2:17,17,11 H:62,17,11 V:17,62,11 H:67,45,1,45 V:45,67,45,1
has been used here.
Example 3
| Before | After |
|---|---|
![]() example3-before.jpg (2944 B) |
![]() example3-after.jpg (2845 B) |
This is (a part of) a picture I have actually taken with my digital camera. The green dot has been removed with the command:
jpegpixi example3-before.jpg example3-after.jpg 33,52,7
[ Top of Page ]
![[example1-before.jpg]](example1-before.jpg)
![[example1-after.jpg]](example1-after.jpg)
![[example2-before.jpg]](example2-before.jpg)
![[example2-after.jpg]](example2-after.jpg)
![[example3-before.jpg]](example3-before.jpg)
![[example3-after.jpg]](example3-after.jpg)