Re: [Gnome-print] Encoding in postscript output



Hello!

On 05 Jun 2001 04:04:28 -0400, Scott Gifford wrote:
> I've been playing with getting a 48MB PS file (a 300dpi, 8.5x11,
> 24-bit color bitmapped image) down to a reasonable size.  I've found
> that for my particular image, I can reduce it to 29MB by using ASCII85
> encoding, and further reduce it to <1MB by using RunLength encoding
> and ASCII85 encoding.  At this size, it prints about 10 times faster
> (1 minute instead of 10)

;-)

> Barring objections, I'm going to start work on integrating these
> encodings into gnome-print for images.  The encoding code seems to be
> there already for PDF files, and I have a working implementation of
> encoders/decoders in Perl to work with.
> 
> My plan is to fix up the PDF encoders so they can work with blocks at
> a time, instead of requiring the whole string to be read in, as
> discussed near the top of gnome-print-pdf.c.

IMPORTANT!
Use 'gnome-1-4-branch' CVS branch for your work. HEAD is not yet
patched for DSC conformance, and consequently uses inappropriate
program structure. In -1-4- everything is buffered to disk, and final
job composed in ::close(), HEAD sends everything directly to
printer. While it does not make big difference, it would be easier
for me to merge everything once.

Michael Sweet did some work for ASCII85, but I had to comment it out in
0.29, as I had no time to make it to work. But if you can write support
RLE+ASCII85, it would be cool.

> I'll then create a compile-time option to encode images with
> RLE+ASCII85 instead of ASCIIHex.

Just add compile-time option, and we'll take care avout everything
else - i.e. whether to make it user-settable or not. Or better yet - add
a bitfield to GnomePrintPS2, and set in in ::init to some #defined
constant.

> My current implementation will add about 700 bytes of overhead to
> every postscript output file, to define a wrapper for showimage that
> makes decoding straightforward.  Is there any way around this for
> documents that don't use images at all?

Yes, add bitfield whether rasters are used, and in ::close embed
necessary header only if needed.

> I'll probably rewrite the current hex conversion stuff to use a hex
> encoder in the same style as the RLE and ASCII85 encoders, for
> consistency's sake.
> 
> Anybody have any thoughts/advice/objections?

Best wishes,
Lauris Kaplinski






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]