# Data compression <!-- MICROSIMGEN:BEGIN v1.7 — generated by g08_place_microsims.py; three.js first (§15); do not hand-edit inside --> ## Microsims — p5.js ### Data compression (p5.js) · `reduce bits` <div class="microsim-player"> <iframe src="https://editor.p5js.org/sciencenibber/full/h_FAyPprM" width="100%" height="480" frameborder="0" loading="lazy" sandbox="allow-scripts allow-same-origin" title="Data compression — p5.js microsim"></iframe> </div> *Represent information in fewer bits by removing redundancy — lossless if exact, lossy if approximate.* **Open in the editor:** [&#9654; fork this sketch](https://editor.p5js.org/sciencenibber/sketches/h_FAyPprM) · movement *V · Coding, compression & communication* · library `p5js` ### Related microsims Live sims on neighbouring articles — 6 of them inside this article's own Wikipedia link tree: - [[Companding]] *(in tree)* - [[Convolution]] *(in tree)* - [[Delta_modulation]] *(in tree)* - [[Differential_pulse-code_modulation]] *(in tree)* - [[Discrete_cosine_transform]] *(in tree)* - [[Discrete_wavelet_transform]] *(in tree)* *Sim hosted off-article; the article owns the reference, not the runtime (WIKI_RULES §10.4). Placed by `g08_place_microsims.py`.* <!-- g09-shelf-note --> > **Also on this page:** 1 further p5.js sketch already published for this article live further down. Per WIKI_RULES §5 a collision promotes rather than forks — they are one shelf, not rivals; this block is the §10.4 *current best* reference. <!-- MICROSIMGEN:END --> ## Microsim ### Live player <div class="microsim-player"> <iframe src="https://editor.p5js.org/sciencenibber/full/GWZgWRFjz" width="100%" height="620" frameborder="0" sandbox="allow-scripts allow-same-origin"></iframe> </div> <div class="microsim-fallback"> <img src="Microsims/thumbs/Data_compression.png" alt="Data_compression microsim poster" style="width:100%;border:1px solid #4445;border-radius:6px;"> <p><em>Live microsim (desktop) · <a href="https://editor.p5js.org/sciencenibber/sketches/GWZgWRFjz">open sketch in the p5.js editor</a></em></p> </div> **Editor URL:** https://editor.p5js.org/sciencenibber/sketches/GWZgWRFjz **Description (100 words):** This sketch makes Shannon's source coding theorem tangible. Four symbols A, B, C, D each get a weight slider; the weights normalize into a probability distribution shown as a [[Bar_chart|bar chart]]. From those probabilities the sketch builds the optimal Huffman prefix code live, labelling each bar with its codeword, and computes the average code length L. A meter on the right stacks three quantities on a shared bit scale: the [[Entropy|entropy]] floor H, the Huffman average L, and the naive 2-bit fixed-length code. As you skew the distribution, H falls and Huffman tracks it, illustrating H <= L < H + 1 and why redundancy is what compression removes. ```js // ===================================================================== // Article : Data compression // Slug : Data_compression // Wikitube : en.wikitube.io/wiki/Data_compression // Room : Information // // Idea : Lossless compression is bounded below by entropy. This // sketch lets the reader reshape a 4-symbol source by // dragging probability weights, then builds the optimal // Huffman prefix code live and compares its average code // length L against Shannon's entropy floor H(X) and the // naive 2-bit fixed-length code. As the distribution gets // more skewed, H drops, Huffman tracks it, and the // compression ratio against the fixed code improves. When // the source is uniform, H = L = 2 bits and there is // nothing to compress -- the central lesson of source // coding. // // Equation : Shannon source coding theorem (noiseless): // H(X) = -Σ p_i log₂ p_i ≤ L = Σ p_i ℓ_i < H(X) + 1 // (ASCII form lives in the text() footer at the bottom.) // ===================================================================== // Rule §3 -- single source of truth for title/URL/save-name. const ARTICLE = "Data_compression"; // Rule §4 -- disable the Friendly Error System for ship. p5.disableFriendlyErrors = true; // ---------- runtime state ---------- let wSliders = []; // four probability-weight sliders (w_A..w_D) const SYM = ["A", "B", "C", "D"]; // the four source symbols const FIXED_BITS = 2; // naive fixed-length code = ceil(log2(4)) // palette (rule §8 -- at most three accent colors) const C_BAR = [40, 90, 200]; // probability bars (blue) const C_HUFF = [220, 130, 40]; // Huffman / code length (orange) const C_ENT = [220, 60, 60]; // entropy floor (red) // layout constants computed in setup() let chartX, chartY, chartW, chartH; function setup() { // Rule §5 -- canvas inside setup, standard size, 2x density. createCanvas(720, 520); pixelDensity(2); // Probability-bar chart panel (top-left region of the canvas). chartX = 70; chartY = 95; chartW = 300; chartH = 250; // Rule §6 -- four weight sliders, built in setup, positioned in a // dedicated bottom strip so the thumbs never cross the readouts // (see pitfalls 2026-04-30 slider/readout overlap). Defaults give a // skewed source (8,4,2,2) so the reader lands on a non-trivial frame. const defaults = [8, 4, 2, 2]; for (let i = 0; i < 4; i++) { const s = createSlider(1, 32, defaults[i], 1); s.position(150, height - 92 + i * 22); s.style("width", "180px"); wSliders.push(s); } } function draw() { background(248); // ---------- read controls ---------- const w = wSliders.map((s) => s.value()); const total = w.reduce((a, b) => a + b, 0); const p = w.map((wi) => wi / total); // normalized probabilities // ---------- math ---------- const H = entropy(p); // Shannon entropy (bits/symbol) const codes = huffman(p); // {len:[], code:[]} optimal prefix code const L = p.reduce((acc, pi, i) => acc + pi * codes.len[i], 0); // avg code length const compRatio = L / FIXED_BITS; // Huffman vs fixed-length (lower is better) // ---------- reference geometry (rule §8 layer 1) ---------- // Chart frame + gridlines for the probability bars. stroke(210); strokeWeight(1); line(chartX, chartY, chartX, chartY + chartH); // y axis line(chartX, chartY + chartH, chartX + chartW, chartY + chartH); // x axis noStroke(); fill(150); textFont("system-ui"); textSize(10); textAlign(RIGHT, CENTER); for (let g = 0; g <= 4; g++) { const gy = chartY + chartH - (g / 4) * chartH; stroke(235); line(chartX, gy, chartX + chartW, gy); noStroke(); fill(150); text((g / 4).toFixed(2), chartX - 6, gy); } // ---------- active geometry (rule §8 layer 2) ---------- // Probability bars (blue), each annotated with its Huffman codeword. const slot = chartW / 4; const barW = slot * 0.55; textAlign(CENTER, BOTTOM); for (let i = 0; i < 4; i++) { const bx = chartX + slot * i + (slot - barW) / 2; const bh = p[i] * chartH; const by = chartY + chartH - bh; fill(C_BAR[0], C_BAR[1], C_BAR[2]); noStroke(); rect(bx, by, barW, bh, 3); // probability value above each bar fill(60); textSize(11); text(p[i].toFixed(3), bx + barW / 2, by - 2); // symbol + its Huffman codeword below the axis (orange) fill(C_HUFF[0], C_HUFF[1], C_HUFF[2]); textSize(13); textAlign(CENTER, TOP); text(SYM[i], bx + barW / 2, chartY + chartH + 6); textSize(11); fill(120); text(codes.code[i], bx + barW / 2, chartY + chartH + 24); textAlign(CENTER, BOTTOM); } // ---------- bits-per-symbol comparison meter (right side) ---------- // Three horizontal markers on a 0..2 bit scale: entropy floor H (red), // Huffman average L (orange), fixed-length 2 bits (grey). Visually, // H <= L <= 2 always holds. const meterX = 430; const meterY = 110; const meterW = 230; const meterH = 200; const bitsMax = 2; stroke(210); strokeWeight(1); noFill(); rect(meterX, meterY, meterW, meterH); noStroke(); // fixed-length reference (full bar, grey) drawBitsRow(meterX, meterY + 30, meterW, FIXED_BITS, bitsMax, [150, 150, 150], "fixed 2-bit code = 2.000"); // Huffman average L (orange) drawBitsRow(meterX, meterY + 90, meterW, L, bitsMax, C_HUFF, "Huffman L = " + L.toFixed(3)); // entropy floor H (red) drawBitsRow(meterX, meterY + 150, meterW, H, bitsMax, C_ENT, "entropy H = " + H.toFixed(3)); // ---------- HUD watermark (rule §2) ---------- noStroke(); textFont("system-ui"); // §2a -- top-left title block. fill(20); textSize(20); textAlign(LEFT, TOP); text("Data compression", 16, 14); textSize(12); fill(110); text("Wikitube microsim - en.wikitube.io/wiki/" + ARTICLE, 16, 40); // §2b -- top-right control hints. textAlign(RIGHT, TOP); textSize(11); fill(110); text("sliders: w_A w_B w_C w_D (symbol weights -> probabilities)", width - 16, 14); text("Huffman code rebuilds live; bits/symbol meter on the right", width - 16, 30); // §2c -- bottom-left live readouts (canonical symbols). textAlign(LEFT, BOTTOM); textSize(13); fill(C_ENT[0], C_ENT[1], C_ENT[2]); text("H = " + H.toFixed(3) + " bits", 16, height - 30); fill(C_HUFF[0], C_HUFF[1], C_HUFF[2]); text("L = " + L.toFixed(3) + " bits", 16, height - 14); fill(60); textAlign(LEFT, BOTTOM); text("ratio L/2 = " + compRatio.toFixed(3) + " redundancy L-H = " + (L - H).toFixed(3), 360, height - 14); // slider labels (rule §7) -- to the LEFT of each slider, right-aligned. textAlign(RIGHT, CENTER); textSize(12); fill(60); for (let i = 0; i < 4; i++) { text("w_" + SYM[i] + " = " + w[i], 142, height - 92 + i * 22 + 8); } // §2d -- bottom-right equation footer (ASCII only -- see pitfalls.md). textAlign(RIGHT, BOTTOM); textSize(11); fill(80); text("H(X) = -Sum p*log2(p) <= L = Sum p*len < H(X)+1", width - 16, height - 30); } // ---------- helpers (rule §10) ---------- // Shannon entropy in bits: H = -Sum p_i log2(p_i), with 0*log0 = 0. function entropy(p) { let h = 0; for (const pi of p) { if (pi > 0) h -= pi * Math.log2(pi); } return h; } // Build an optimal Huffman prefix code for the probabilities p. // Returns {len:[bits per symbol], code:[binary string per symbol]}. // Classic algorithm: repeatedly merge the two lowest-probability nodes. function huffman(p) { const n = p.length; // Leaf nodes carry the symbol index; internal nodes carry children. let nodes = p.map((pi, i) => ({ p: pi, idx: i, left: null, right: null })); // Edge case: a single symbol still needs a 1-bit code. if (n === 1) return { len: [1], code: ["0"] }; // Working pool we shrink by one node per merge. let pool = nodes.slice(); while (pool.length > 1) { pool.sort((a, b) => a.p - b.p); // cheapest two at the front const a = pool.shift(); const b = pool.shift(); pool.push({ p: a.p + b.p, idx: -1, left: a, right: b }); } // Walk the tree, accumulating the bit string for each leaf. const code = new Array(n).fill(""); const len = new Array(n).fill(0); assignCodes(pool[0], "", code, len); return { len, code }; } // Depth-first walk: left edge appends "0", right edge appends "1". function assignCodes(node, prefix, code, len) { if (node.idx >= 0) { // leaf const bits = prefix.length === 0 ? "0" : prefix; code[node.idx] = bits; len[node.idx] = bits.length; return; } assignCodes(node.left, prefix + "0", code, len); assignCodes(node.right, prefix + "1", code, len); } // Draw one labelled horizontal bits-per-symbol marker on a 0..max scale. function drawBitsRow(x, y, w, value, max, col, label) { const frac = constrain(value / max, 0, 1); noStroke(); fill(235); rect(x + 10, y, w - 20, 12, 3); // track fill(col[0], col[1], col[2]); rect(x + 10, y, (w - 20) * frac, 12, 3); // filled portion fill(60); textSize(11); textAlign(LEFT, BOTTOM); text(label, x + 10, y - 3); } ``` ## Links (Wikipedia order) <!-- injected from _registry/childlinks/Data_compression.json (2026-07-30T02:09:12Z) --> `.m2ts` · `3Dc` · `3GPP` · `3GP_and_3G2` · `3ivx` · `7-Zip` · `8.3_filename` · `842_(compression_algorithm)` · `A-law_algorithm` · `AAC-LD` · `AIXI` · `ALZip` · `AMV_video_format` · `APNG` · `ARC_(file_format)` · `ARJ` · `AV1` · `AV2` · `AVIF` · `Absolute_threshold_of_hearing` · `Academic_Press` · `Adaptive_Huffman_coding` · `Adaptive_Multi-Rate_Wideband` · `Adaptive_Multi-Rate_audio_codec` · `Adaptive_coding` · `Adaptive_differential_pulse-code_modulation` · `Adaptive_predictive_coding` · `Adaptive_scalable_texture_compression` · `Adobe_Flash_Player` · `Advanced_Audio_Coding` · `Advanced_Systems_Format` · `Advanced_Video_Coding` · `Alation` · `Algebraic_code-excited_linear_prediction` · [[Algorithm]] · `Algorithm_BSTW` · `Algorithmic_information_theory` · `Alias_(Mac_OS)` · `Alliance_for_Open_Media` · `Apple_Lossless_Audio_Codec` · `Apple_ProRes` · `Apple_Video` · `AptX` · `Arithmetic_coding` · `Ark_(software)` · `Asao_(codec)` · `Asymmetric_numeral_systems` · `Au_file_format` · `Audicom` · `Audio_Interchange_File_Format` · `Audio_Lossless_Coding` · `Audio_Video_Interleave` · `Audio_Video_Standard` · `Audio_codec` · `Audio_coding_format` · `Audio_file_format` · `Audio_signal` · `Auditory_system` · `Average_bitrate` · `Avid_Audio` · `Avid_DNxHD` · `BBC` · `BBC_News` · `BMP_file_format` · `BT_Group` · `Backup` · `Bandlimiting` · `Bandwidth_(computing)` · `Bell_Labs` · `BetterZip` · `Better_Portable_Graphics` · `Big_data` · `Binary_file` · `Bink_Video` · `Bishnu_S._Atal` · `Bit` · `Bit_rate` · `Block_Truncation_Coding` · `Blu-ray` · `Bluetooth_Special_Interest_Group` · `Broadcast_automation` · `Brotli` · `Burrows–Wheeler_transform` · `Business_intelligence` · `Byte-pair_encoding` · `Bzip2` · `C._Chapin_Cutler` · `CELT` · `CRC_Press` · `Canonical_Huffman_code` · `Carla_Brodley` · `Carnegie_Mellon_University` · `Centroid` · `Chain_code` · `Chief_data_officer` · `Chroma_subsampling` · `CineForm` · `Cinepak` · [[Claude_Shannon]] · `Close_(system_call)` · `Code-excited_linear_prediction` · `Codec` · `Codec_2` · `Coding_theory` · `Coding_tree_unit` · `Color_Cell_Compression` · `Color_space` · `Commercial_software` · `Compact_disc` · [[Companding]] · `Comparison_of_audio_coding_formats` · `Comparison_of_file_archivers` · `Comparison_of_file_managers` · `Comparison_of_video_codecs` · `Compress_(software)` · `Compressed_data_structure` · `Compressed_suffix_array` · `Compression_artifact` · `Computational_resource` · `Computer_file` · `Constant_bitrate` · `Container_format` · `Context-adaptive_binary_arithmetic_coding` · `Context-adaptive_variable-length_coding` · `Context_mixing` · `Context_tree_weighting` · `Controlled_vocabulary` · [[Convolution]] · `CoreAVC` · `Curve_fitting` · `DVD` · `DVD-Audio` · `DV_(video_format)` · `Daala` · `Dark_data` · `Data` · `Data_acquisition` · `Data_analysis` · `Data_annotation` · `Data_anonymization` · `Data_archaeology` · `Data_as_a_service` · `Data_augmentation` · `Data_broker` · `Data_cleansing` · `Data_collection` · `Data_compression_ratio` · `Data_compression_symmetry` · `Data_conversion` · `Data_cooperative` · `Data_corruption` · `Data_curation` · `Data_deduplication` · `Data_degradation` · `Data_domain` · `Data_ecosystem` · `Data_editing` · [[Data_engineering]] · `Data_erasure` · `Data_exhaust` · `Data_exploration` · `Data_extraction` · `Data_farming` · `Data_file` · `Data_format_management` · `Data_fusion` · `Data_governance` · `Data_hierarchy` · `Data_infrastructure` · `Data_integration` · `Data_integrity` · `Data_lineage` · `Data_loading` · `Data_localization` · `Data_loss` · `Data_management` · `Data_mesh` · `Data_migration` · `Data_minimization` · `Data_mining` · `Data_philanthropy` · `Data_preparation` · `Data_preservation` · `Data_processing` · `Data_product` · `Data_publishing` · `Data_quality` · `Data_re-identification` · `Data_recovery` · `Data_reduction` · `Data_redundancy` · `Data_remanence` · `Data_rescue` · `Data_retention` · `Data_science` · `Data_scraping` · `Data_scrubbing` · `Data_security` · `Data_sharing` · `Data_steward` · [[Data_storage]] · `Data_structure` · `Data_synchronization` · `Data_type` · `Data_validation` · `Data_warehouse` · `Data_wrangling` · `Daubechies_wavelet` · `David_A._Huffman` · `Deblocking_filter` · `Deflate` · `Delta_encoding` · [[Delta_modulation]] · `Dictionary_coder` · [[Differential_pulse-code_modulation]] · `Digital_Signal_Processing_(journal)` · `Digital_Video_Interactive` · `Digital_camera` · `Digital_cinema` · `Digital_image` · `Digital_twin` · `Dirac_(video_compression_format)` · `Directory_(computing)` · `Directory_structure` · [[Discrete_cosine_transform]] · `Discrete_sine_transform` · [[Discrete_wavelet_transform]] · `Display_resolution` · `DivX` · `DjVu` · `Dolby_AC-4` · `Dolby_Digital` · `Dolby_TrueHD` · `Dynamic_Markov_compression` · `Dynamic_Resolution_Adaptation` · [[Dynamic_range]] · `Dynamic_range_compression` · `Elias_gamma_coding` · `Embedded_zerotrees_of_wavelet_transforms` · `Enhanced_VOB` · `Enhanced_Variable_Rate_Codec` · `Enhanced_Variable_Rate_Codec_B` · `Enhanced_Voice_Services` · `Enhanced_full_rate` · [[Entropy_(information_theory)]] · `Entropy_coding` · `Equal-loudness_contour` · `Essential_Video_Coding` · `Executable_compression` · `Experian` · `Exponential-Golomb_coding` · `Extended_Adaptive_Multi-Rate_–_Wideband` · `Extended_file_attributes` · `Extract,_load,_transform` · `Extract,_transform,_load` · `FAAC` · `FELICS` · `FFV1` · `FFmpeg` · `FLAC` · `FM-index` · [[Fast_Fourier_transform]] · `Fibonacci_coding` · `File-system_permissions` · `File_Roller` · `File_attribute` · `File_comparison` · `File_copying` · `File_descriptor` · `File_format` · `File_manager` · `File_sharing` · `File_size` · `File_synchronization` · `File_system` · `File_system_fragmentation` · `File_transfer` · `File_verification` · `Filename` · `Filename_extension` · `Filename_mangling` · `Filesystem_Hierarchy_Standard` · `Film_frame` · `Filzip` · [[Finite-state_machine]] · `Flash_Video` · `Fourier_transform` · `Fractal_compression` · `Frame_rate` · `Fraunhofer_FDK_AAC` · `FreeArc` · `Free_Lossless_Image_Format` · `Free_and_open-source_software` · `Freeware` · [[Frequency_domain]] · `Full_Rate` · `Fumitada_Itakura` · `G.711` · `G.718` · `G.719` · `G.722` · `G.722.1` · `G.723` · `G.723.1` · `G.726` · `G.728` · `G.729` · `G.729.1` · `GIF` · `Gary_Sullivan_(engineer)` · `General_Exchange_Format` · `Generation_loss` · `Golomb_coding` · `Grammar-based_code` · `Grid_file_system` · `Group_4_compression` · `Gzip` · `H.120` · `H.261` · `H.262/MPEG-2_Part_2` · `H.263` · `HDX4` · `HD_DVD` · `HTTP_compression` · `Hadamard_transform` · `Half_Rate` · `Hard_link` · `Harmonic_Vector_Excitation_Coding` · `Hearing` · `Helix_(multimedia_project)` · `Hidden_file_and_hidden_directory` · `High-Efficiency_Advanced_Audio_Coding` · `High_Efficiency_Image_File_Format` · `High_Efficiency_Video_Coding` · `High_fidelity` · `Hitachi` · `Huffman_coding` · `Huffyuv` · `Hutter_Prize` · `IBM` · `ICER_(file_format)` · `ITU-T` · `ITunes_Store` · [[Image_compression]] · `Image_file_format` · `Image_resolution` · `Incremental_encoding` · `Indeo` · `Info-ZIP` · `Informatica` · [[Information]] · `Information_privacy` · `Information_professional` · `Information_quality` · [[Information_theory]] · `Institution_of_Engineering_and_Technology` · `Inter_frame` · `Interchange_File_Format` · `Interlaced_video` · `International_Electrotechnical_Commission` · `International_Organization_for_Standardization` · `Internet` · `Internet_Engineering_Task_Force` · `Internet_Low_Bitrate_Codec` · `Internet_Speech_Audio_Codec` · `Intra-frame_coding` · `JBIG` · `JBIG2` · `JPEG` · `JPEG_2000` · `JPEG_XL` · `JPEG_XR` · `JPEG_XS` · `JPEG_XT` · `James_L._Flanagan` · `Joint_Photographic_Experts_Group` · `K-means_clustering` · `K._R._Rao` · `KGB_Archiver` · `Kolmogorov_complexity` · `L._Peter_Deutsch` · `L3enc` · `LAME` · `LC3_(codec)` · `LCEVC` · `LDAC_(codec)` · `LG_Electronics` · `LHA_(file_format)` · `LHDC_(codec)` · `LZ4_(compression_algorithm)` · `LZ77_and_LZ78` · `LZFSE` · `LZMA` · `LZRW` · `LZWL` · `LZX` · `Lagarith` · `Lapped_transform` · `Large_language_model` · `Latency_(audio)` · `Latency_(engineering)` · `Lempel–Ziv–Oberhumer` · `Lempel–Ziv–Stac` · `Lempel–Ziv–Storer–Szymanski` · `Lempel–Ziv–Welch` · `Levenshtein_coding` · `Libavcodec` · `Libvpx` · `Line_spectral_pairs` · `Linear_prediction` · `Linear_predictive_coding` · `List_of_codecs` · `List_of_file_formats` · `List_of_file_signatures` · `Lists_of_filename_extensions` · `Log_area_ratio` · `Long_filename` · `Lossless_compression` · `Lossy_compression` · `Luminance` · `Lyra_(codec)` · `Lzip` · `Lzop` · `MATLAB` · `MOD_and_TOD` · `MP3` · `MPEG-1` · `MPEG-1_Audio_Layer_I` · `MPEG-1_Audio_Layer_II` · `MPEG-2` · `MPEG-21` · `MPEG-4` · `MPEG-4_Part_2` · `MPEG-4_SLS` · `MPEG-H` · `MPEG-H_3D_Audio` · `MPEG_LA` · `MPEG_Multichannel` · `MPEG_Surround` · `MPEG_elementary_stream` · `MPEG_media_transport` · `MPEG_program_stream` · `MPEG_transport_stream` · `MSU_Lossless_Video_Codec` · `MT9` · `MacBinary` · [[Machine_learning]] · `Macroblock` · `Magic_number_(programming)` · `Manfred_R._Schroeder` · `Mark_Adler` · `Marketing_information_system` · `Master_Quality_Authenticated` · `Master_data` · `Master_data_management` · `Matching_pursuit` · `Material_Exchange_Format` · `Matroska` · `Meridian_Lossless_Packing` · `Metadata` · `Microsoft_Silverlight` · `Microsoft_Video_1` · `Minimum_description_length` · `Mitsubishi_Electric` · `Mixed-excitation_linear_prediction` · `Modified_Huffman_coding` · `Modified_discrete_cosine_transform` · `Modulo-N_code` · `Monkey's_Audio` · `Motion_JPEG` · `Motion_JPEG_2000` · `Motion_coding` · `Motion_compensation` · `Motion_estimation` · `Move-to-front_transform` · `Moving_Picture_Experts_Group` · `Mu-law_algorithm` · `Multimedia` · `Multiple-image_Network_Graphics` · `Musepack` · `NETVC` · `NTFS_links` · `Nagoya_University` · `Negafibonacci_coding` · `Nero_AAC_Codec` · `Nero_Digital` · `Netflix` · `Nikil_Jayant` · `Nippon_Telegraph_and_Telephone` · [[Nyquist–Shannon_sampling_theorem]] · `OMS_Video` · `Ogg` · `On2_Technologies` · `OpenCV` · `OpenEXR` · `OpenH264` · `Open_(system_call)` · `Open_data` · `Open_file_format` · `OptimFROG` · `Opus_(audio_format)` · `Oracle_Corporation` · `Original_Sound_Quality` · `PAQ` · `PKZIP` · `PNG` · `PackBits` · `Pack_(software)` · `Packetized_elementary_stream` · `Panasonic` · `Parametric_stereo` · `Path_(computing)` · `Pax_(command)` · `PeaZip` · `Peak_signal-to-noise_ratio` · `Perceptual_coding` · `Phil_Katz` · `PictureTel` · `Pixel` · `Pixlet` · `PowerArchiver` · `Prediction_by_partial_matching` · `Prefix_code` · `Probability_distribution` · `Proceedings_of_the_IEEE` · `Progressive_Graphics_File` · `Proprietary_file_format` · `Psychoacoustics` · `Pulse-code_modulation` · `Pyramid_(image_processing)` · `Pyramid_vector_quantization` · `QOI_(image_format)` · `Qlik` · `Qualcomm_code-excited_linear_prediction` · `Quantization_(image_processing)` · [[Quantization_(signal_processing)]] · `QuickTime` · `QuickTime_Animation` · `QuickTime_File_Format` · `QuickTime_Graphics` · `QuickTime_VR` · `RTVideo` · `Random-access_memory` · `Randomized_algorithm` · `Range_coding` · `RatDVD` · `Rate–distortion_theory` · `Re-Pair` · `Read_(system_call)` · `Real-time_Transport_Protocol` · `RealAudio` · `RealMedia` · `RealVideo` · `Recursive_indexing` · `Redundancy_(information_theory)` · `Reference_data` · `Relaxed_code-excited_linear_prediction` · `Request_for_Comments` · `Residual_frame` · `Resource_Interchange_File_Format` · `Run-length_encoding` · `Rzip` · `S2TC` · `S3_Texture_Compression` · `SAP` · `SAS_Institute` · `SBC_(codec)` · `SILK` · `SVOPC` · [[Sampling_(signal_processing)]] · `Selectable_Mode_Vocoder` · `Semantic_file_system` · `Sequitur_algorithm` · `Set_partitioning_in_hierarchical_trees` · `Set_redundancy_compression` · `Shadow_(OS/2)` · `Shannon's_source_coding_theorem` · `Shannon_coding` · `Shannon–Fano_coding` · `Shannon–Fano–Elias_coding` · `SheerVideo` · `Shortcut_(computing)` · `Shorten_(codec)` · `Sidecar_file` · [[Signal_processing]] · `Silence_compression` · `Siren_(codec)` · `Smacker_video` · `Smallest_grammar_problem` · `Smart_Bitrate_Control` · `Snappy_(compression)` · `Society_of_Motion_Picture_and_Television_Engineers` · `Software` · `Sony` · `Sorenson_Media` · `Sound_card` · `Sound_quality` · `Source_code` · `Space–time_tradeoff` · `Sparse_file` · `Spectrogram` · [[Speech_coding]] · `Speex` · `Standard_test_image` · `Statistical_inference` · `StuffIt` · `StuffIt_Expander` · `Sub-band_coding` · `Super_Audio_CD` · `Symbolic_link` · `System_file` · `TIFF` · `TIFF/EP` · `TUGZip` · `Taylor_&_Francis` · `Temporary_file` · `Temporary_folder` · `TensorFlow` · `Terry_Welch` · `Text_file` · `Texture_compression` · `The_Atlantic` · `The_Unarchiver` · `Theora` · `Thomas_Wiegand` · `Thor_(video_codec)` · [[Time_domain]] · `Timeline_of_information_theory` · `TooLAME` · `Topological_data_analysis` · `Toshiba` · `Trade-off` · `Transaction_data` · `Transform_coding` · `Truncated_binary_encoding` · `Tunstall_coding` · `TurboQuant` · `TwinVQ` · `UPX` · `Unary_coding` · `Uncompressed_video` · `Unified_Speech_and_Audio_Coding` · `Universal_code_(data_compression)` · `University_of_Buenos_Aires` · `University_of_Utah` · `Ut_Video_Codec_Suite` · `VC-1` · `VC-6` · `VHS` · `VOB` · `VP3` · `VP6` · `VP8` · `VP9` · `Value_of_information` · `Variable-Rate_Multimode_Wideband` · `Variable_bitrate` · `Vector_quantization` · `Vector_sum_excited_linear_prediction` · `Versatile_Video_Coding` · `Video` · `Video_Coding_Experts_Group` · `Video_codec` · `Video_coding_format` · `Video_compression_picture_types` · `Video_quality` · `Vimeo` · `Vorbis` · `WAV` · `Warped_linear_predictive_coding` · `WavPack` · `Wavelet` · `Wavelet_scalar_quantization` · `Wavelet_transform` · [[Wayback_Machine]] · `WebM` · `WebP` · `WinAce` · `WinRAR` · `WinZip` · `Windows_Media_Audio` · `Windows_Media_Encoder` · `Windows_Media_Video` · `Wireless_Application_Protocol_Bitmap_Format` · `World_Scientific` · `World_Wide_Web_Consortium` · `Write_(system_call)` · `X264` · `X265` · `XAD_(software)` · `XZ_Utils` · `Xarchiver` · `Xvid` · `YULS` · `YouTube` · `ZPAQ` · `Zero-byte_file` · `ZipGenius` · `Zipeg` · `Zstd` ## From the Real GENERATIVE library ![Data compression](https://upload.wikimedia.org/wikipedia/commons/a/a4/Comparison_of_JPEG_and_PNG.png) *Data compression — placed from the Real G.E.N.E.R.A.T.I.V.E. course library (Information room). Source: Wikimedia Commons (via Wikipedia article media). [Details & license](https://commons.wikimedia.org/wiki/File:Comparison_of_JPEG_and_PNG.png).* > In information theory, data compression, source coding,[1] or bit-rate reduction is the process of encoding information using fewer bits than the original representation.[2] Any particular compression is either lossy or lossless. Lossless compression reduces bits by identifying and eliminating statistical redundancy. ([Wikipedia](https://en.wikipedia.org/wiki/Data_compression)) <!-- REAL-GENERATIVE-MEDIA:END --> > **Room:** [[Information]] · **Status:** ✅ shipped ## Overview In [[Information_theory|information theory]], data compression, source coding,1 or bit-rate reduction is the process of encoding information using fewer bits than the original representation.2 Any particular compression is either lossy or lossless. Lossless compression reduces bits by identifying and eliminating statistical redundancy. No information is lost in lossless compression. Lossy compression reduces bits by removing unnecessary or less important information.3 Typically, a device that performs data compression is referred to as an encoder, and one that performs the reversal of the process (decompression) as a decoder. _(Overview is shorter than 200 words; the pipeline should expand it from textbook context before publishing.)_ ## See also - Room hub: [[Information]] - p5.js Editor conventions: P5 JS EDITOR - Wiki root: MAIN --- *Scaffolded by `generative-microsim` from row 1 of the Information sheet on 2026-06-02T14:27:51Z.* Letters: probability · entropy · mined_information · distribution · encoding · mined_system · chart_glyph_dictionary · mined_geometry <!-- REAL-GENERATIVE-MEDIA:START --> <!-- CRAFT-LINK:START g12 --> *Built to the [[WT!P5_js_Microsim_Master_Class|p5.js Master Class]].* <!-- CRAFT-LINK:END --> ## Wikipedia : Wikitube **Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Data_compression) : [Wikitube](https://en.wikitube.io/wiki/Data_compression) ## Previous hub tags Tree parent: [[Information_theory]]. Legacy hubs: `GENERATIVE`. --- *Sources: 2 legacy notes. Minted wave 1, 2026-07-30 (v1.6 order).*