Programs for

JPEG - Idea and Practice


JPEG.zip


Part one


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

          into a picture (called "trpict") of the cosine transformed values.

     ICosTrans restores the picture from the converted picture, press a key for the picture as file (called "repict").


     BMP_JPG converts a BMP file into a "jpg" 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 redrawing

          press a key for the picture as file (with a dash 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 entered into the Comment segment of the JPEG file.

          If the BMP file is accompanied by a picture in jpg-format named "hidpict", this picture will be entered into the segments AAP1-APP15 (60 Kb in each).

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


***


Hide a picture in a picture

     The program "HidePict" enters one or more pictures named pict1, pict2, ..., pictn (n < 10), after the datastream of a picture named "pict", the new picture is named "pict_". The hidden pictures (of a picture named "pict") are produced by the program "GetHidPict", they are named "pict1", "pict2", ...

     The program "HidePictAPP" enters a picture named "hidpict" into the header of a picture named "pict". The picture is entered into the AAP1-APP15 segments (60 Kb in each), and these must be empty. The hidden picture (of a picture named "pict") is produced by the program "GetHidPictAPP", it is named "hidpict_".

     The program "HideText" enters a text in txt-format named "text" into the Comment segment of a picture named "pict" - the Comment segment must be empty. The hidden text is shown by the program "ShowText".

     The picture to be hidden can of course be any file temporarily named "pict.jpg".

     The program "EmptyAPP" or "EmptyCOM" empties a given APP segment (APP1-APP15) or the Comment segment, respectively, of a picture named "pict".


September 2021


This site is a subsection of juliasets.dk