{"id":21654331,"url":"https://github.com/saurabhrkp/image-compression","last_synced_at":"2025-03-20T04:40:38.967Z","repository":{"id":100843382,"uuid":"220535496","full_name":"Saurabhrkp/Image-Compression","owner":"Saurabhrkp","description":"Mini project on Image Compression and Decompression","archived":false,"fork":false,"pushed_at":"2019-11-09T11:55:48.000Z","size":359,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T06:24:53.044Z","etag":null,"topics":["huffman-tree","image-compression","java","lossy-compression"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saurabhrkp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-08T19:36:37.000Z","updated_at":"2024-12-08T17:27:12.000Z","dependencies_parsed_at":"2023-06-10T09:15:17.011Z","dependency_job_id":null,"html_url":"https://github.com/Saurabhrkp/Image-Compression","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FImage-Compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FImage-Compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FImage-Compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saurabhrkp%2FImage-Compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saurabhrkp","download_url":"https://codeload.github.com/Saurabhrkp/Image-Compression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554121,"owners_count":20471172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["huffman-tree","image-compression","java","lossy-compression"],"created_at":"2024-11-25T08:27:29.965Z","updated_at":"2025-03-20T04:40:38.945Z","avatar_url":"https://github.com/Saurabhrkp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Compression in Java\nMini project on Image Compression and Decompression\n\nData Compression is the process of reduction in size of data in order to save\nspace or transmission time. Information usually contains redundancies i.e\ninformation is often repeated. Examples include reoccurring letters,\nnumbers or pixels. Compression programs remove this redundancy.\n\n## Steps\n\nDownload .java file and test.jpg\n\nCompile .java file\nIn Cmd/bash run\n\n`javac Compression.java `\n\nExecute .class file\n\n`java Compression`\n\n## Arithmetic Coding\nArithmetic coding is a common algorithm used in both lossless and lossy data\ncompression algorithms. It is an entropy encoding technique, in which the\nfrequently seen symbols are encoded with fewer bits than rarely seen\nsymbols.\n\nHow does Arithmetic coding work –\n\n• It converts the entire input data into a single floating point number n\nwhere (0.0 \u003c= 1.0).\n\n• The interval is divided into sub-intervals in the ratio of the probability of\noccurrence frequencies.\n\n• For a startpoint and endpoint of an entire range the lower-limit of a\ncharacter range is the upper-limit of the previous character given by\nstartpoint + cumulativefrequency X (endpoint -startpoint )\n\n• Therefore, each interval corresponds to one symbol.\n\n• The first symbol restricts the tag position to be in one of the intervals.\n\n• The reduced interval is partitioned recursively as more symbols are\nprocessed.\n\n• Observation: once the tag falls into an interval, it never gets out of it.\n\n## Huffman Coding\nHuffman coding is one of the basic compression methods, that have proven\nuseful in image and video compression standards. When applying Huffman\nencoding technique on an Image, the source symbols can be either pixel\nintensities of the Image, or the output of an intensity mapping function. The\npixel intensity values in the input Image will be addressed as leaf nodes of\nthe Huffman tree.\n\nNow, there are 2 essential steps to build a Huffman Tree :\n\n1. Build a Huffman Tree :\n\n  - Combine the two lowest probability leaf nodes into a new node. \n  \n  - Replace the two leaf nodes by the new node and sort the nodes according to the new probability values.\n  \n3. Continue the steps (a) and (b) until we get a single node with\nprobability value 1.0. We will call this node as root\n\n2. Backtrack from the root, assigning ‘0’ or ‘1’ to each intermediate node, till\nwe reach the leaf nodes\n\nDiscrete Cosine Transform A discrete cosine transform (DCT) expresses a\nfinite sequence of data points in terms of a sum of cosine functions oscillating\nat different frequencies. DCTs are important to numerous applications in\nscience and engineering, from lossy compression of audio (e.g. MP3) and\nimages (e.g. JPEG) (where small high-frequency components can be\ndiscarded), to spectral methods for the numerical solution of partial\ndifferential equations.\n\nIn particular, a DCT is a Fourier-related transform similar to the discrete\nFourier transform (DFT), but using only real numbers. The DCTs are\ngenerally related to Fourier Series coefficients of a periodically and\nsymmetrically extended sequence whereas DFTs are related to Fourier\nSeries coefficients of a periodically extended sequence. DCTs are equivalent\nto DFTs of roughly twice the length, operating on real data with even\nsymmetry (since the Fourier transform of a real and even function is real and\neven), whereas in some variants the input and/or output data are shifted by\nhalf a sample. There are eight standard DCT variants, of which four are\ncommon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhrkp%2Fimage-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaurabhrkp%2Fimage-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaurabhrkp%2Fimage-compression/lists"}