[tex-eplain] PNG and TIFF-G4 bitmaps in plain TeX

laurent at math.toronto.edu laurent at math.toronto.edu
Wed Dec 3 01:54:30 CET 2014

   ***  Better integration of big black-white bitmaps ***

--- is a more informative title.
Greetings Hartmut, Karl and others,

 Hartmut 29 Nov 2014 >
 > ...but pdftex & luatex support native
 > JBIG2 bitonal image inclusion, just in the same
 > way as shown above (extension .jb2 or .jbig2).
 > JBIG2 is ideal if one wants e. g. to put many
 > b/w scans into a pdf file with very high data
 > compression. According to
 > http://en.wikipedia.org/wiki/JBIG2,
 > this image type "typically generates files one
 > third to one fifth the size of Fax Group 4",
 > which is the TIFF-G4 contents.

Hartmut was responding to what Karl Berry
had written on 19 Dec 2013:

Karl >    have not wrestled with the somewhat obscure command
 >     syntax for pdfTeX
 > Well, it's not *too* obscure :) --
 >   \immediate\pdfximage width<dimen> {foo.png}
 >   \pdfrefximage\pdflastximage
 > will scale foo.png to the given width.
 > Or height<dimen>, of course.  (I do this all the time.)
 > Any supported image type (jpg and pdf being the most common others) can
 > be handled that way.
 > However, for more complicated operations, such as reflection, clipping,
 > etc., using the LaTeX packages as Oleg mentioned is the way to go.
 > Regarding tiff, pdftex does not support it.

All this suggests that an old problem of
mine (lurking since 1998) is finally solved.
Namely that of that of integrating numerous
high resolution b/w (bitonal) bitmaps in an
efficient TeX production process to get a final
high quality but compact output file (say
in format PDF or DjVu).

Hitherto I have mostly used horribly bulky EPSF
graphics files to inefficiently derive a horribly bulky
PDF file that http://any2djvu.djvuzone.org/
miraculously transforms into a high quality
compact DjVu file.

There is still one missing process though. How
can one conveniently convert common-a-garden
TIF-G4 b/w graphics files to the (hopefully!)
optimally compact ".jbig2" = ".jb2" format??
(I am guessing that the final PDF output will
include the "jbig2" file more or less intact.)

To boost us up the steep learning curve to
happiness with pdftex, I would like to ask
Hartmut for an absolutely autonomous
demonstration project based on e-TeX or Plain TeX
and running under pdftex. It would be extremely
helpful to most of us to have explanations for
the magical pdfTeX commands \immediate,
\pdfximage, \pdfrefximage, and \pdflastximage.


Laurent S.

PS1: Who can point out a significant public posting
in ".jb2" format  ??

PS2. There does exist a MSWindows based viewer


called "stdUviewer" that claims to directly
view ".jb2" files. Remarkably, t works OK on ".djvu" files
and many many others.

More information about the tex-eplain mailing list