Programs for

JPEG - Idea and Practice


The compiled programs

The uncompiled programs + Pascal compiler


Part one


     CosTrans converts a (quadratic) picture in BMP format called "pict"

          to a picture (called "trans_pict") of the cosine transformed values.

     ICosTrans re-form the picture from the converted picture, press a key for the picture as file (called "reform_pict").


     BMP_JPG converts a BMP file to a JPEG file:

          enter the name - if the picture has transparency it must be accompanied

               by a monochrome picture with name addition z

          enter the size of the small squares (2-24)

          press G for a grey scale file

          enter two quality factors (one for a grey scale file)

               the file extension is _c.jpg for colour, _g.jpg for grey scale and _t.jpg for transparency

     ShowJPG draws the picture from a _c.jpg, or a _g.jpg or a _t.jpg file:

          enter the name (without file extension)

          enter the number of terms in the inverse cosine procedure

          the picture can be removed by the arrows (Shift for smaller steps)

          click or scroll for re-drawing

          press a key for the picture file (with a hyphen added to the name)


Part two


Header

     JPEG_File shows the header part of a JPEG file (of sequential DCT type) called "pict".


Grey scale

     CJPEGg produces a grey scale JPEG file (called "pict") of a BMP file called "pict".

     CJPEGgh version of CJPEGg which pre-scans the picture and constructs Huffman tables from frequencies - a quality p.c. is to be entered.

     DJPEGg draws the picture of a grey scale JPEG file (of sequential DCT type) called "pict".


Colour

     CJPEG produces a JPEG file (called "pict") of a BMP file called "pict" - (H1,V1) is set to (2,2) and the quality p.c. is set to 70.

          (H1,V1) can be set to (1,1) or (2,1) or (1,2) or (2,2), and a new quality p.c. can be chosen,

          if the values are written in a txt document named "DefineHVq":

                     write first the two bytes H1 and V1 just after one another and press Enter,

                     write then the quality p.c. a natural number from 1 to 100.

          If the BMP file is accompanied by a txt document named "text", this text will be written in the Comment segment of the JPEG file.

     DJPEG draws the picture of a JPEG file (of sequential DCT type) called "pict".


May 2019


This site is a subsection of juliasets.dk