Re: LZW decode for images - syntax
- From: James Lee <sp4m_m3@xxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 11:37:36 +0100
On Tue, 13 Sep 2005 08:32:26 -0700, Namit Bhalla wrote:
> Hi,
> I have a monochrome bitmap image that I compress using LZW and send to
> a printer. Can anyone please clarify if the following syntax is
> correct:
>
> width height 1 [width 0 0 height 0 0] currentfile /LZWDecode filter
> image {LZW compressed data}
>
> I have the following grey areas:
> 1. How to specify the compressed data which is in binary format?
Encode as ASCII. Use either HEX or ASCII85
> Should I enclose it in angular brackets <> ?
Not when reading from currentfile you just need the end marker.
Example:
%!
54 112 translate
120 120 scale
/SIZE 24 def
/DeviceGray setcolorspace
<<
/ImageType 1
/Width SIZE
/Height SIZE
/BitsPerComponent 1
/Decode [0 1]
/ImageMatrix [SIZE 0 0 SIZE neg 0 SIZE]
/DataSource currentfile /ASCII85Decode filter /LZWDecode filter
>>
image
J,fg^!!&Sr,X;Hg,QNZH5SR?,#E*&Bebk42^X7UQpeWpTE=Mtb6\*,YpiaCf9=>K"hLl`LfKk9hn/OUl
!T/D-)rL];$igD$kTq"(7fYe>~>
showpage
> 2. I understand that the standard LZW algorithm has no provision for
> EOD marker. So, should I add the EOD myself after the compressed data?
> Is this EOD marker always 257 for LZW?
Yes.
.
- Follow-Ups:
- Re: LZW decode for images - syntax
- From: Namit Bhalla
- Re: LZW decode for images - syntax
- References:
- LZW decode for images - syntax
- From: Namit Bhalla
- LZW decode for images - syntax
- Prev by Date: Re: Newbie seeks stack enlightenment
- Next by Date: Re: network printers with gswin32 (8.5)
- Previous by thread: LZW decode for images - syntax
- Next by thread: Re: LZW decode for images - syntax
- Index(es):
Relevant Pages
|