{"id":18153448,"url":"https://github.com/thinknathan/node-simple-pixelate","last_synced_at":"2025-04-07T00:53:03.560Z","repository":{"id":213323639,"uuid":"733623358","full_name":"thinknathan/node-simple-pixelate","owner":"thinknathan","description":"Command-line tool that pixelates images to create pixel art","archived":false,"fork":false,"pushed_at":"2025-03-01T13:52:24.000Z","size":1044,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T14:35:13.775Z","etag":null,"topics":["cli-tool","gamedev-tool","node-cli","pixel-art"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thinknathan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-19T18:43:35.000Z","updated_at":"2025-03-01T13:52:21.000Z","dependencies_parsed_at":"2024-01-28T00:54:23.495Z","dependency_job_id":"ddc6b51b-f1bc-45ea-9e80-bd8f488a4712","html_url":"https://github.com/thinknathan/node-simple-pixelate","commit_stats":null,"previous_names":["thinknathan/node-simple-pixelate"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fnode-simple-pixelate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fnode-simple-pixelate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fnode-simple-pixelate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Fnode-simple-pixelate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinknathan","download_url":"https://codeload.github.com/thinknathan/node-simple-pixelate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247574097,"owners_count":20960495,"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":["cli-tool","gamedev-tool","node-cli","pixel-art"],"created_at":"2024-11-02T03:07:05.160Z","updated_at":"2025-04-07T00:53:03.532Z","avatar_url":"https://github.com/thinknathan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"docs/banner.png\" alt=\"Simple Pixelate\"\u003e\n\n# Simple Pixelate\n\n[![CI](https://github.com/thinknathan/node-simple-pixelate/actions/workflows/ci.yml/badge.svg)](https://github.com/thinknathan/node-simple-pixelate/actions/workflows/ci.yml) ![GitHub License](https://img.shields.io/github/license/thinknathan/node-simple-pixelate)\n\nCommand-line utility that pixelizes images to create pixel art. Inspired by [pyxelate](https://github.com/sedthh/pyxelate), but for Node.\n\n## Examples\n\n- `--colorLimit 16 --scale 0.5 --afterScale 2`\n\n  - \u003cimg src=\"docs/melody.jpg\" alt=\"Cartoon face on box in front of full coffee cup\"\u003e \u003cimg src=\"docs/melody-d_none-c_16.png\" alt=\"Cartoon face in limited 16-colour palette\"\u003e\n  - [Photo source](https://unsplash.com/photos/a-cup-of-coffee-sitting-on-top-of-a-white-table-McEh5jAOD3w)\n\n- `--colorLimit 2 --ditherAlgo atkinson --contrast -0.09 --grayScale true`\n\n  - \u003cimg src=\"docs/sharon.jpg\" alt=\"Shirtless man on dark background\"\u003e \u003cimg src=\"docs/sharon-d_atkinson-c_2.png\" alt=\"Shirtless man in dithered black and white style\"\u003e\n  - [Photo source](https://unsplash.com/photos/grayscale-photo-of-topless-man-JiSjwGZ-1nA)\n\n- `--ditherAlgo floyd`\n\n  - \u003cimg src=\"docs/single.jpg\" alt=\"Single tree in snowy landscape\"\u003e \u003cimg src=\"docs/single-d_floyd-c_8.png\" alt=\"Single tree in 8 colour palette with banding reduced by dithering\"\u003e\n  - [Photo source](https://unsplash.com/photos/a-lone-tree-in-the-middle-of-a-snowy-field-zrxHB6gcO0g)\n\n## Install\n\n1. Install [Nodejs](https://nodejs.org/en) or equivalent\n\n2. Clone this project\n   `git clone https://github.com/thinknathan/node-simple-pixelate`\n\n3. Install dependencies\n   `npm i`\n   or\n   `yarn`\n\n4. Install for command-line usage\n   `npm link`\n\n## Usage\n\n- Process a file:\n\n  - `px -f myImage.png`\n\n- Get all available options:\n\n  - `px --help`\n\n- Valid input formats: `jpeg`, `png`, `bmp`, `tiff`, `gif`\n- Output format is `png`\n\n### Options\n\n- `filename` (-f):\n\n  - Purpose: Specifies the input image filename.\n  - Use Case: Useful when you want to process a single specific image.\n\n- `folderPath` (-i):\n\n  - Purpose: Specifies the input folder containing multiple images.\n  - Use Case: Useful when you want to process multiple images in a batch, and the images are stored in a specific folder.\n\n- `scale` (-s):\n\n  - Purpose: Scales the image up or down by a factor.\n  - Use Case: Allows you to resize images to a desired scale, useful for adjusting image dimensions.\n\n- `afterScale` (-a):\n\n  - Purpose: Rescales the image up or down by this factor, as the last step.\n  - Use Case: Allows you to resize the final image up, creating a blocky look that may be more pleasing than using `pixelSize`.\n\n- `cubic` (-u):\n\n  - Purpose: Uses bicubic interpolation instead of bilinear for initial resizing.\n  - Use Case: Enables a smoother, more accurate resizing technique that is slower. Has no effect on `afterScale` which always uses nearest neighbour.\n  - Default: true\n\n- `contrast` (-x):\n\n  - Purpose: Adjusts contrast by a value between -1 and +1.\n  - Use Case: Useful for enhancing or reducing the contrast in your images.\n\n- `pixelSize` (-z):\n\n  - Purpose: Adjusts blockiness by pixel size.\n  - Use Case: Can be used to control the level of pixelation in your output image.\n\n- `ditherAlgo` (-d):\n\n  - Purpose: Specifies the dithering algorithm: `floyd`, `bayer`, `atkinson`, or `none`.\n  - Use Case: Dithering is a technique used to reduce color banding in images; you can choose the algorithm that provides the desired result.\n\n- `alphaThreshold` (-t):\n\n  - Purpose: Adjusts transparent pixels to hide/show based on threshold.\n  - Use Case: Useful for controlling the visibility of transparent pixels in your image.\n  - Default: 0.6\n\n- `colorLimit` (-c):\n\n  - Purpose: Limits the number of colors in the output image.\n  - Use Case: Useful for creating images with a reduced color palette, which can be desirable for certain artistic or display constraints.\n  - Default: 8\n\n- `palette` (-p):\n\n  - Purpose: Uses a predefined custom palette. Overrides `colorLimit`.\n  - Use Case: You can choose from a variety of predefined color palettes to give your images a specific look and feel.\n  - Options:\n\n  - APPLE_II_HI\n  - GAMEBOY_ORIGINAL\n  - GAMEBOY_COMBO_UP\n  - GAMEBOY_COMBO_DOWN\n  - GAMEBOY_COMBO_LEFT\n  - GAMEBOY_COMBO_RIGHT\n  - GAMEBOY_A_UP\n  - GAMEBOY_A_DOWN\n  - GAMEBOY_A_LEFT\n  - GAMEBOY_A_RIGHT\n  - GAMEBOY_B_UP\n  - GAMEBOY_B_DOWN\n  - GAMEBOY_B_LEFT\n  - GAMEBOY_B_RIGHT\n  - GAMEBOY_POCKET\n  - GAMEBOY_VIRTUALBOY\n  - TELETEXT\n  - BBC_MICRO\n  - CGA_MODE4_PAL1\n  - CGA_MODE5_PAL1\n  - CGA_MODE4_PAL2\n  - ZX_SPECTRUM\n  - APPLE_II_LO\n  - COMMODORE_64\n  - MICROSOFT_WINDOWS_16\n  - MICROSOFT_WINDOWS_20\n  - PICO_8\n  - MSX\n  - MONO_OBRADINN_IBM\n  - MONO_OBRADINN_MAC\n  - MONO_BJG\n  - MONO_BW\n  - MONO_PHOSPHOR_AMBER\n  - MONO_PHOSPHOR_LTAMBER\n  - MONO_PHOSPHOR_GREEN1\n  - MONO_PHOSPHOR_GREEN2\n  - MONO_PHOSPHOR_GREEN3\n  - MONO_PHOSPHOR_APPLE\n  - APPLE_II_MONO\n  - MONO_PHOSPHOR_APPLEC\n  - APPLE_II_MONOC\n  - MICROSOFT_WINDOWS_PAINT\n  - AMSTRAD_CPC\n  - ATARI_2600\n  - ATARI_5200\n  - ATARI_7800\n  - ATARI_LYNX\n\n- `customPalette` (-o):\n\n  - Purpose: Specifies a custom palette in the format [[r, g, b], [r, g, b], ...]. Overrides `palette` and `colorLimit`.\n  - Use Case: Allows you to define your own color palette for image processing.\n\n- `lowPass` (-l):\n\n  - Purpose: Uses a lowpass filter to reduce noise.\n  - Use Case: Useful for improving image quality by reducing noise.\n  - Default: false\n\n- `randomColor` (-r):\n\n  - Purpose: Uses randomness when reducing the palette to colorLimit.\n  - Use Case: Adds a random element to color reduction, providing variation in your output.\n  - Default: true\n\n- `normalize` (-n):\n\n  - Purpose: Normalizes image color for consistency.\n  - Use Case: Ensures consistent color representation across your images.\n  - Default: true\n\n- `grayScale` (-g):\n\n  - Purpose: Transforms the image to grayscale.\n  - Use Case: Converts your image to black and white, useful for specific artistic effects.\n  - Default: false\n\n- `width` (-w):\n\n  - Purpose: Specifies the output image width. Overrides `scale` and `afterScale`.\n  - Use Case: Allows you to set a specific width for your output image.\n\n- `height` (-h):\n  - Purpose: Specifies the output image height. Overrides `scale` and `afterScale`.\n  - Use Case: Allows you to set a specific height for your output image.\n\n## Background\n\nCreated with Chat-GPT 3.5.\n\n## License\n\nThis repo is [CC0-1.0](LICENSE) unless otherwise specified.\n\n`definedPalettes.ts` is adapted from [pyxelate](https://github.com/sedthh/pyxelate) and carries their MIT license.\n\nImages in `docs` carry the [Unsplash License](https://unsplash.com/license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinknathan%2Fnode-simple-pixelate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinknathan%2Fnode-simple-pixelate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinknathan%2Fnode-simple-pixelate/lists"}