Questions tagged [lzw]

LZW (Lempel-Ziv-Welch) is a compression algorithm which supersedes LZ78.

LZW (Lempel-Ziv-Welch) is a compression algorithm which supersedes LZ78.

You can find more information about LZW on Wikipedia.

185 questions
0
votes
0 answers

I wrote code that uses the LZW Algorithm, what are ways that could work or fail when running the program?

What are some ways when running the code that uses the LZW Algorithm for Compression/Decompression that would cause the code to fail and work?
Lucy Jones
  • 31
  • 6
0
votes
0 answers

LZW Sequence implementation

I am absolutely lost on what I am supposed to do in this C programming assignment I have. I am pretty sure I created the newSequence function wrong, because there isn't much clarity, for me, on what all the variables mean. Can someone guide me on…
0
votes
0 answers

Incomplete sequence when using strcat() to with char converted to char array in LZW compression

I have the following code below. It can successfully convert .txt files to LZW compressed files, however, when I run it on a .jpg (which should in theory work). The first char/int it reads is "255", then strcat() tries to concatenate k_str to wk on…
0
votes
1 answer

Problem with storing 9 bits codes in buffer for lzw compression

For my LZW compression code. I chose to store the codes in 9-bit codes, dictionary size will be 512, so there will be room for only 256 new symbols. Now I feel like I didn't choose the right buffer for the job: byte[] buffer = new byte[3]; This…
Koolio
  • 1
  • 2
0
votes
0 answers

Extra bytes are added when I run my compressed file in my decompression method

I'm working with text files here. My LZW decompression doesn't seem to work correctly. Something is wrong when I try to decompress my compressed file back: I get extra bytes added to the text file after decompression. As of now, I found the sequence…
user12211444
0
votes
1 answer

Decompress TIFF-File

I have a Tiff-File (BigTiff, because it is ~8GB). Now I want to scale it down (4K Resolution) and I am struggling to find the correct software. When I find a software or lib which can handle Tiff-Files they have Problems with BigTiff, Dimesion (My…
Lee
  • 819
  • 7
  • 32
0
votes
1 answer

lzw decompression algorithm in java for given compressed text

I have following compressed text given as a byte Array: byte[] compressed = [97, 2, 10, 28, 72, -80, -96, -63, -125, 8, 19, 42, 92, -56, -80, -95, -61, -121, 16, 35, 74, -100, 72, -79, -94, -59, -117, 24, 51, 106, -36, -56, -79, -93, -57, -113, 32,…
Glyx
  • 53
  • 8
0
votes
0 answers

LZW decoding function

Here is a lzw decoding function, it decodes the input image. i dont understand how it is doing this , i will appreciate it if anyone could explain it for me def lzw_decode(encoded_img, decoded_img): with open(encoded_img, "rb") as f: …
Nasim
  • 161
  • 1
  • 3
  • 12
0
votes
1 answer

Decoding TIFF LZW codes not yet in the dictionary

I made a decoder of LZW-compressed TIFF images, and all the parts work, it can decode large images at various bit depths with or without horizontal prediction, except in one case. While it decodes files written by most programs (like Photoshop and…
Michel Rouzic
  • 1,013
  • 1
  • 9
  • 22
0
votes
1 answer

LZW compression & dictionary implementation using hashing

I have a long text which has to be compressed using LZW compression algorithm. I have to assign 16 bit code for sequence of ASCII characters. for eg 'aa' will have 16-bit code '0000000010000000' (just available after 'DEL' ie 0000000001111111). Now…
0
votes
1 answer

Compression ratio of LZW, LZ77 and other easy-to-implement algorithms

I want to compress .txt files that contains dates in yyyy-mm-dd hh:mm:ss format and english words that sometimes tend to be repeated in different lines. I read some articles about compression algorithm and find out that in my case dictionary based…
Okumo
  • 169
  • 1
  • 12
0
votes
1 answer

Element disapears while calling a function - LZW Compression

I made some research but nothing was really concerning my problem... I'm actually trying to code LZW compression for school, and I need a function to check if an element is in my dictionnary. However, when I'm calling this function, it tries to…
maleik
  • 33
  • 1
  • 1
  • 7
0
votes
0 answers

decompress LZW tif data by C#

I got the following information from Tiff file. ImageWidth Short 2977 ImageLength Short 5613 BitsPerSample Short 2 Compression Short LZW PhotometricInterpretation Short WhiteIsZero StripOffsets Long [(22)] SamplesPerPixel Short 1 RowsPerStrip…
S Yu
  • 1
0
votes
0 answers

LZW- Compression in Python

For a university course work exam, I need to write code that computes a LZW compression on a string, with specific requirements, then translates via Elias coding into numbers. We are allowed to use the internet/friends/other examples to do this…
0
votes
0 answers

What format should I send data in when using the ~DY command in ZPL2 on a Zebra GK420d for the fastest printing?

I am trying to speed up the printing of a 4x6 inch png image. I have converted the image to print from ZPL2 on my GK420d printer. The options specified by the ZPL 2 programming guide are: ASCII Hexadecimal ZB64 Binary Which of these options will…
seedub
  • 1