-
JPEGIMG: Conversion between JPEG and IMG or BMP raster formats
Direct access to online help: JPEGIMG
Access the application from the menu:
"File | Import | Rasters | JPEG -> IMG/BMP"
"File | Export | IMG/BMP -> JPEG"
Presentation and options
This application converts between the MiraMon IMG format or the BMP format (without georeferencing), to the JPEG format with MiraMon metadata, or the JPEG format (without georeferencing). There are several options:
Header information:
(Option 0) Shows metadata
IMG/BMP to JPEG:
(Option 1) Converts IMG/BMP to JPEG. In this option a BMP(FileIn), or an IMG image with a grey scale palette (FileIn), or an IMG with a P25 palette (FileIn and FileP25) or an RGB combination (FileR, FileG and FileB) are converted to a single JPEG file (FileJPEG).
JPEG to IMG/BMP:
(Option 2) From JPEG to IMG/BMP: This option converts a JPEG file (FileJPEGs) to a BMP file (FileIn), or to an IMG file with a grey scale palette (FileIn), or to an IMG file with a predefined P25 palette (FileIn and FileP25), or to an IMG file with an optimised P25 palette (FileIn and FileP25), o to an RGB combination (FileR, FileG, and FileB).
IMG/BMP to JPEG Indexat:
(Option 3) Convert IMG/BMP to a indexed JPEG convert IMG/BMP to JPEG. In this option a BMP(FileIn), or an IMG image with a grey scale palette (FileIn), or an IMG with a P25 palette (FileIn and FileP25) or an RGB combination (FileR, FileG and FileB) are converted to a single Indexed JPEG file (FileJPEG).
IMG/BMP Multiband to JPEG:
(Option 1) From IMG/BMP to JPEG. This option converts a JPEG file (FileJPEGs) to a BMP file (FileIn), or to an IMG file with a grey scale palette (FileIn), or to an IMG file with a predefined P25 palette (FileIn and FileP25), or to an IMG file with an optimised P25 palette (FileIn and FileP25), o to an RGB combination (FileR, FileG, and FileB).
Joint Photographic Experts Group (JPEG) refers to a still-picture compression standard that specifies several modes of operation. The mode used by the Independent JPEG Group's (IJPEG) software is sequential buildup (knowkn as JFIF); in this mode, each component of an image is encoded in a left-to-right and top-to-bottom scan. Sequential mode is lossy, which means that when you compress an image, you will lose information. One reason that sequential mode JPEG is lossy is that the algorithm compresses an image by removing visually insignificant information, colors that the human eye cannot detect. The JPEG committee has not specified a standard file format, and consequently, many applications of the JPEG algorithm use their own proprietary format. In spite of that, last years, JFIF format has been consolidated as an standard 'de facto'. For that reason MiraMon decided to incorporate this implementatión of JPEG format as a raster image format.
MiraMon uses the IMG format for categorical and continuous value rasters, whether in uncompressed format (in many cases compatible with Idrisi 16) or in the highly compressed RLE format. For more details about the IMG formats and how to convert between them consult either the on-line help ImgImg or the MiraMon manual. The RLE compression used in the IMG format is not lossy, meaning that the raster can be compressed and later decompressed to recover the original image with no changes to the cell values. In the category images this property is essential given that two close numerical values may represent completely different categories. It is also important when dealing with radiometric images (remote sensing) where the value of a pixel represents a physical measurement of electromagnetic radiation.
On the other hand, the IJPEG implementation of the JPEG format is a high compression format but with some degradation or loss; the values of the uncompressed image approximate those of the original image but they are not always the same. The level of degradation can be controlled with a parameter (/QUALITAT) during compression, but it can never be eliminated altogether. Visually the results are very good, even with low quality levels (higher compression rate); for this reason the format is appropriate for photographic images such as orthometric aerial photographs in black and white or colour (whether they are 24 bit or 8 bit images with colour palettes). It is also a suitable format for continuous value images when you want a high compresion ratio with a good visual look but lossing the original values of the image.
For the JPEG format the application saves the metadata (including the georeference) in an REL v.4 file. Thanks to this property, MiraMon can visualize georeferenced files in JPEG format; they need fewer disk space and are perfectly integraded in the GIS. It is also possible to import or generate files without metadata for display in an image processing program.
When generating a JPEG file the application takes account of NODATA vales and, where possible, reserves a colour to represent this value.
This version only allows and generates palettes in P25 format. Convert them from MiraMon if necessary using the option 'Guardar paleta'. The RGB combination should be made up of 3 files in IMG byte format or byte-RLE format. If combinations with other formats are required display a 24 bit combination from MiraMon and save the displayed images as a BMP from the file menu of MiraMon; then convert the BMP to JPEG.

Dialog box of the application

Syntax:
JPEGIMG 1/2 FileJPEG FileIn [FileP25]
JPEGIMG 1/2 FileJPEG FileR FileG FileB
- Option 1: convert IMG/BMP to JPEG. In this option a BMP(FileIn), or
an IMG image with a grey scale palette (FileIn), or an IMG with a P25
palette (FileIn and FileP25) or an RGB combination (FileR, FileG and
FileB) are converted to a single JPEG file (FileJPEG). The optional
parameters are:
- /QUALITAT=N Quality of compression, in the range [0,100], where
[5,95] is the useful range but, in many cases, we use a value
between 70 and 75 (by default is 75). Low values means very low
quality but high compression.
- /GRISOS Creates a grey scale JPEG: converting a colour raster to
grey scale (monochrome).
- /OPTIMITZAT Optimise the Huffman table (the file will be smaller
but the compression will be slower).
- /PROGRESSIU Creates a progressive JPEG. This type of JPG permits
preview during the first phases of decompression.
- /DENOM_ESCALA= Denominator of the scale at which the JPEG should
be printed, or 0 if the user does not wish to specify a scale. The
information about the raster cell size, together with this parameter
are used to save internally in the JPEG file the output image pixel
size in paper units, such as ppi (pixels per inch).
- /NO_METADADES Indicates that we don't want to create a
metadata file asociaded with JPEG file based on metadata form IMG
files. It's created by default. It doesn't apply when the
file to transform is not an IMG.
- Option 2: from JPEG to IMG/BMP: This option converts a JPEG file
(FileJPEGs) to a BMP file (FileIn), or to an IMG file with a grey scale
palette (FileIn), or to an IMG file with a predefined P25 palette
(FileIn and FileP25), or to an IMG file with an optimised P25 palette
(FileIn and FileP25), o to an RGB combination (FileR, FileG, and FileB).
The optional parameters are:
- /NCOLORS=n Forces a reduction of the colour space to a limited
number of colours, n. This will be the final number of colours in
the palette if IMG+optimised palette is requested.
- /MAP_PAL Forces the colour space to a specific palette. Note
that if this option is selected the program reads the indicated
palette from disk. If this option is not selected the program writes
an optimised palette for this particular image.
- /NO_SUAVIZAT Allows not passing the smoothing filter to improve
the final results.
- /1PAS Use only one quantization pass. The result is obtained
quicker but with lower quality. It requares fewer memory.
- /ESCALAT=m/n Output scale expressed as a fraction m/n, e.g: 1/8.
This parameter can be useful when the image, once decompressed,
would be unacceptably big.
All files specified should include their extensions. The JPEG
format is often written in many cases with the extension
"jpg" or "jpe". This application allows to
generate or reed with any of this extensions, but the other
applications and modules of MiraMon want the "jpg"
extension. Also the JPEG format with metadata of MiraMon we add to the
file with "jpg" extensio a file with "J.rel"
termination that has the georeference and the metadata.

This application supports and generates REL v.4
The routines used to compress and decompress of JPEG format are partially based on the work of "Independent JPEG Group" (IJPEG).
Idrisi is a program (c) of J.Ronald Eastman and Clark University