{"id":15657577,"url":"https://github.com/fenwick67/term-px","last_synced_at":"2025-05-05T15:51:28.360Z","repository":{"id":65515462,"uuid":"62478037","full_name":"fenwick67/term-px","owner":"fenwick67","description":"Write pixels to the terminal in vertical pairs","archived":false,"fork":false,"pushed_at":"2018-12-19T17:27:24.000Z","size":109,"stargazers_count":24,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T22:11:18.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://fenwick67.github.io/term-px","language":"JavaScript","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/fenwick67.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}},"created_at":"2016-07-03T02:27:43.000Z","updated_at":"2025-03-19T04:53:52.000Z","dependencies_parsed_at":"2023-01-26T21:25:12.120Z","dependency_job_id":null,"html_url":"https://github.com/fenwick67/term-px","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/fenwick67%2Fterm-px","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenwick67%2Fterm-px/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenwick67%2Fterm-px/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fenwick67%2Fterm-px/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fenwick67","download_url":"https://codeload.github.com/fenwick67/term-px/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252034531,"owners_count":21684151,"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":[],"created_at":"2024-10-03T13:08:28.059Z","updated_at":"2025-05-05T15:51:28.340Z","avatar_url":"https://github.com/fenwick67.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# term-px\n\nWrite pixels to the terminal using ANSI colors and half-characters.  [Try it here](http://fenwick67.github.io/term-px).\n\nVerified to work in Windows CMD, Git Bash, xterm, and more.\n\n![Demo](http://i.imgur.com/iwlN1Ru.gif)\n\nYou can see it yourself by running `img-test.js`.\n\n## WHAT?\n\nI'm kinda cheating.  Using special characters (namely ▀ █ and ▄) we're able to write an approximation of actual pixels to the terminal.\n\n\n## Examples:\n\n```javascript\nvar termPx = require('term-px');\n\n/*\n\ndefault usage\n\n*/\n\nvar pixels = termPx([0,0,0],[255,255,255])\n  //  =\u003e '\\u001b[97;40m▄\\u001b[0m'\n  //  =\u003e \u003cblack on top and white on bottom\u003e\n\n// provide an options object with \"format\" set to \"rgb\" for use in full color terminals\nvar rgbPixels = termPx([0x9A,0x00,0xC4],[0xBB,0x00,0xC4],{format:\"rgb\"});\n  //  =\u003e \"\\u001b[38;2;154;0;196;48;2;187;0;196m▀\\u001b[0m\"\n  //  \u003ctwo slightly different purples\u003e\n\n// set \"reset\" to false to not reset the color at the end.\nvar unClosedRgbPixels = termPx([0x9A,0x00,0xC4],[0xBB,0x00,0xC4],{format:\"rgb\",reset:false});\n  //  =\u003e \"\\u001b[38;2;154;0;196;48;2;187;0;196m▀\"\n\n/*\n\nPreparing images:\n\n*/\n\n// Image data must be in RGBA 0-255 format, and have data and width keys.\nvar bmp = require(\"bmp-js\");\nvar bmpBuffer = fs.readFileSync('aa.bmp');\nvar bmpData = bmp.decode(bmpBuffer); // {data:[255,0,255,255,...],width:10,height:20}\n\nvar logo = termPx.convertImage(bmpData,{format:\"rgb\"});\n  // =\u003e (a massive String)\n\nprocess.stdout.write(logo)\n  // logo is shown\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenwick67%2Fterm-px","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenwick67%2Fterm-px","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenwick67%2Fterm-px/lists"}