{"id":17317393,"url":"https://github.com/fangwei123456/python-jpeg-encoder","last_synced_at":"2025-04-14T14:15:34.528Z","repository":{"id":41242037,"uuid":"175573806","full_name":"fangwei123456/python-jpeg-encoder","owner":"fangwei123456","description":"create a standardized JPEG file","archived":false,"fork":false,"pushed_at":"2019-03-14T08:33:55.000Z","size":712,"stargazers_count":46,"open_issues_count":3,"forks_count":12,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-14T14:15:25.617Z","etag":null,"topics":["encode","image-processing","jpeg","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fangwei123456.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-14T07:52:09.000Z","updated_at":"2024-12-29T08:39:21.000Z","dependencies_parsed_at":"2022-08-31T10:22:49.807Z","dependency_job_id":null,"html_url":"https://github.com/fangwei123456/python-jpeg-encoder","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/fangwei123456%2Fpython-jpeg-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fangwei123456%2Fpython-jpeg-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fangwei123456%2Fpython-jpeg-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fangwei123456%2Fpython-jpeg-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fangwei123456","download_url":"https://codeload.github.com/fangwei123456/python-jpeg-encoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894943,"owners_count":21179153,"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":["encode","image-processing","jpeg","python"],"created_at":"2024-10-15T13:16:28.323Z","updated_at":"2025-04-14T14:15:34.499Z","avatar_url":"https://github.com/fangwei123456.png","language":"Python","readme":"# python-jpeg-encoder\n\nA jpeg encoder written in python. It can encode a BMP image file to a JPEG file. A jpeg decoder written in python is not needed because the encoder will create a standardized JPEG file, which can be opened with any picture viewer.\n\n### **Usage:**\n\n`python jpegEncoder.py inputBMPFileName outputJPEGFileName quality(from 1 to 100) debugMode(0 or 1)`\n\nExample:\n\n`python ./jpegEncoder.py ./lena.bmp ./output.jpg 95 0`\n\n### **More information:**\n\nIf `debugMode` is 1, you will get more details about encoding process.\n\nFor example, run `jpegEncoder.py` by:\n\n`python ./jpegEncoder.py ./8x8.bmp ./output.jpg 95 1`\n\nAnd you will get:\n\nsrcImageWidth = 8 srcImageHeight = 8  \nsrcImage info:  \n \u003cPIL.BmpImagePlugin.BmpImageFile image mode=RGB size=8x8 at 0x7F9E8AD4F908\u003e  \nadded to:  8 8  \nyImageMatrix:  \n [[255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]  \n [255 255 255 255 255 255 255 255]]  \nuImageMatrix:  \n [[128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]]  \nvImageMatrix:  \n [[128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]  \n [128 128 128 128 128 128 128 128]]  \nluminanceQuantTbl:  \n [[ 2  1  1  2  2  4  5  6]  \n [ 1  1  1  2  3  6  6  6]  \n [ 1  1  2  2  4  6  7  6]  \n [ 1  2  2  3  5  9  8  6]  \n [ 2  2  4  6  7 11 10  8]  \n [ 2  4  6  6  8 10 11  9]  \n [ 5  6  8  9 10 12 12 10]  \n [ 7  9 10 10 11 10 10 10]]  \nchrominanceQuantTbl:   \n [[ 2  2  2  5 10 10 10 10]  \n [ 2  2  3  7 10 10 10 10]  \n [ 2  3  6 10 10 10 10 10]  \n [ 5  7 10 10 10 10 10 10]  \n [10 10 10 10 10 10 10 10]  \n [10 10 10 10 10 10 10 10]  \n [10 10 10 10 10 10 10 10]  \n [10 10 10 10 10 10 10 10]]  \nblockSum =  1  \nblock (y,x):  0 0  -\u003e  8 8  \nyDctMatrix:  \n [[1024.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]  \n [   0.    0.    0.    0.    0.    0.    0.    0.]]  \nuDctMatrix:  \n [[8. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]]  \nvDctMatrix:  \n [[8. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]]  \nyQuantMatrix:  \n [[512.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]  \n [  0.   0.   0.   0.   0.   0.   0.   0.]]  \nuQuantMatrix:  \n [[4. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]]  \nvQuantMatrix:  \n [[4. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]  \n [0. 0. 0. 0. 0. 0. 0. 0.]]  \nencode dyDC: 512  \nisLuminance= 1 (size,value)= 10 512 code= [1, 1, 1, 1, 1, 1, 0] [1, 0, 0, 0, 0, 0, 0, 0, 0, 0]  \nencode yAC: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]  \nEOB [1, 1, 0, 0]  \nencode duDC: 4  \nisLuminance= 0 (size,value)= 3 4 code= [1, 0, 1] [1, 0, 0]  \nencode uAC: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]  \nEOB [0, 1]  \nencode dvDC: 4  \nisLuminance= 0 (size,value)= 3 4 code= [1, 0, 1] [1, 0, 0]  \nencode vAC: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]  \nEOB [0, 1]\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffangwei123456%2Fpython-jpeg-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffangwei123456%2Fpython-jpeg-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffangwei123456%2Fpython-jpeg-encoder/lists"}