Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PCX
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Image data compression=== {{Unreferenced section|date=January 2024}} PCX image data are compressed using [[run-length encoding]] (RLE), a simple [[lossless compression]] algorithm that collapses a series of three or more consecutive bytes with identical values into a two-byte pair. The two most-significant bits of a byte are used to determine whether the given data represent a single [[pixel]] of a given palette index or color value, or an RLE pair representing a series of several pixels of a single value: # If both bits are 1, the byte is interpreted as the run length. This leaves 6 bits for the actual run length value, a range of 0-63. # In any other case, the byte is interpreted as a single pixel value. This leaves all values for which bit #7 and bit #8 are not 1 at the same time. This allows all values under 192 to be encoded in a single byte. Due to the use of the two most-significant bits as flags, pixel values from 192 to 255 (with their most-significant bit already set) must be stored in an RLE byte pair, even when they only occur one or two pixels in succession, whereas color indexes 0 to 191 can be stored directly or in RLE byte pairs (whichever is more space-efficient); therefore, the actual compression ratio could be optimized with proper sorting of palette entries, though this is not feasible where the file must share its color palette with other images. For example, a palette could be optimized with the most commonly used colors occurring in palette positions 0 to 191 and the least common colors allocated to the remaining quarter of the palette. Another inefficiency with the RLE algorithm is that it is possible to store chunks with a length of 0, which allows whitespace in the file. This allowed PCX files to be decompressed slightly faster{{How?|date=January 2024}} on the processors it was originally intended for.{{Contradictory inline |reason=So is it an inefficiency or an optimization for the intended target?|date=January 2024}} The PCX compression algorithm requires very little processor power or memory to apply, a significant concern with computer systems when it was designed. Compression algorithms used by newer image formats are more efficient when compressing images such as photographs, and [[dithering|dithered]] or otherwise complex graphics.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)