{"id":13337746,"url":"https://github.com/RiftTeam/multicolor","last_synced_at":"2025-03-11T07:30:49.486Z","repository":{"id":184736725,"uuid":"474191033","full_name":"RiftTeam/multicolor","owner":"RiftTeam","description":"Converter for mulitcolor-mode on the TIC-80.","archived":false,"fork":false,"pushed_at":"2023-11-22T21:52:28.000Z","size":310,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-28T07:28:08.767Z","etag":null,"topics":["demoscene","tic-80","tic80"],"latest_commit_sha":null,"homepage":"","language":"Python","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/RiftTeam.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog","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}},"created_at":"2022-03-25T23:24:35.000Z","updated_at":"2023-07-29T22:29:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"d15c4d0f-b85f-41b1-bd37-89d1bcd225ca","html_url":"https://github.com/RiftTeam/multicolor","commit_stats":null,"previous_names":["riftteam/multicolor"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiftTeam%2Fmulticolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiftTeam%2Fmulticolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiftTeam%2Fmulticolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiftTeam%2Fmulticolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RiftTeam","download_url":"https://codeload.github.com/RiftTeam/multicolor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213069711,"owners_count":15532844,"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":["demoscene","tic-80","tic80"],"created_at":"2024-07-29T19:14:56.458Z","updated_at":"2024-10-23T16:31:26.042Z","avatar_url":"https://github.com/RiftTeam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![mulTIColor Logo](https://repository-images.githubusercontent.com/474191033/6b4ec005-585c-4c27-a4f4-b6eea5f3b6ea)\n\nmulTIColor\n===========\n\nA converter for multicolor-mode on the [TIC-80](https://tic80.com/).\n\nThe [TIC-80](https://tic80.com/) normaly supports a max. [resolution](https://github.com/nesbox/TIC-80/wiki/display) of 240 pixels x 136 pixels with a [palette](https://github.com/nesbox/TIC-80/wiki/palette) of 16 RGB-colors.\nBut it is possible to change the palette every scanline with some [tweaks](https://github.com/nesbox/TIC-80/wiki/palette#more-than-16-colors), resulting in max. 2176 or even 4216 colors on screen.\n\n**mulTIColor** converts an image (240 x 136 pixels or smaller) to a version with max. 16 or 31 colors per line.\nThe result will be saved as an image and as a [Lua](https://www.lua.org)-script with all the palettes, pixels and a display-routine (when using the \"o\"-option). Images with 16 or less colors (indexed) will be converted too, but with a single palette.\n\n\nInformation\n===========\n\nTo reduce the colors to 16/31 per line, there are 3 options by default to achieve this:\n1. [PIL](https://pillow.readthedocs.io/en/stable/) (Python Image Library, built-in)\n2. [IrfanView](https://www.irfanview.com/) (external executable)\n3. [ImageMagick](https://imagemagick.org/index.php) (external executable)\n\nYou might have to adjust the paths for [IrfanView](https://www.irfanview.com/) and [ImageMagick](https://imagemagick.org/index.php) in the configfile (**mtc.cfg**).\nYou can also add other converters or paths for a different operating system to the config aswell. Make sure to include the three keywords **{IN}**, **{OUT}** and **{RANGE}** to your entries. \nThey ensure, that the current line of the image which is written to a temporary file can be converted and imported again afterwards. There is an optional keyword **{TEMPDIR}**, which can be used to store additional files for a converter like [IrfanView](https://www.irfanview.com/), if needed.\n\nBased on the source image, all available options should be tried and the best result can be used directly.\nBut it is recommended to manually edit/optimize the best result by the creator of the original image.\n\nWhen using the -o option, a .[lua](https://www.lua.org)-script will be generated (too), which contains the palettes and pixel data.\nThe **pal**-variable will contain 136 palettes with 16 or 31 RGB-colors, each in hex (from 00 to ff).\nThe **gfx**-variable will contain 240 x 136 pixels (color-index in hex, from 0 to f with 16 colors / from 00 to 1e with 31 colors).\nWhen using [RLE (Run-length encoding)](https://en.wikipedia.org/wiki/Run-length_encoding) the palettes and pixels are stored in the **rlp**- and **rlg**-variable.\n\n\nRequirements\n============\n\n- Python (3.6, or greater) - https://www.python.org/\n- Pillow (Python Imaging Library) - https://pypi.org/project/Pillow/\n\n\nInstallation\n============\nIf missing, **Pillow** can be installed using **pip** (for Python3).\n\nLinux: \n\n    $ pip install pillow\nWindows:\n\n    $ python -m pip install pillow\n\n\nQuickstart\n==========\n\n**mulTIColor** is easy to use and its really simple to convert an image to multicolor-mode.\nJust run `multicolor` using the provided example images:\n\n    $ multicolor.py piggie_power_without_the_price.png\n\n    Generates a preview of the converted image, will be shown by the OS's default image viewer.\n\nSpecify an output name to generate the lua-script and save the preview:\n\n    $ multicolor.py kittens.png -o smallcats\n\t\n\tThe preview is saved as \"smallcats-mtc.png\" and the lua-script as \"smallcats.lua\".\n\nUse a different converter to reduce the colors of the image per line:\n\n    $ multicolor.py dryad.png -c iview -o resultsmyvary\n\t\n\tHave a look at the provided config file \"mtc.cfg\" for the paths and binaries.\n\nSwitch the range to 31 colors per line to get a, hopefully, better result:\n\n    $ multicolor.py kittens.png -c iview -r 31 -o somemorecolors\n\nEncode the pixel data as rle (run-length encoded) to save some space:\n\n    $ multicolor.py kittens.png -o smallerscript -m rle\n\nSet a bordercolor to prevent streaking (will reduce colors per line to 15/30):\n\n    $ multicolor.py gameboys.png -o blackborder -b 0 0 0\n\n\nCommandline options\n===================\n\n    $ multicolor.py --help\n\t\n    Usage: multicolor imagefile [OPTION...]\n    Generate TIC-80 multicolor images\n    \n    mandatory arguments:\n      imagefile          imagefile with graphicsdata (e.g.: .png, .gif, etc.)\n    \n    optional arguments:\n      -c, --converter    converter: pil (default), see mtc.cfg for more\n      -o, --output       outputfile for multicolor values (.lua)\n      -f, --force        force overwrite of outputfile when it already exist\n      -r, --range        range of colors per line (16 or 31)\n      -b, --bordercolor  bordercolor (R G B) to prevent streaking\n      -m, --mode         mode to encode values: raw (default) or rle\n      -v, --version      show version info\n      -h, --help         show this help\n    \n    The optional arguments are only needed if the default setting does not meet the\n    required needs. A specific name for the outputfile can be set (-o / --output).\n    The maximum range (-r / --range) of colors per line, can be set to 16 or 31.\n    To prevent colorstreaking in the border, a specific color (-b / --bordercolor)\n    can be set. WARNING: this will reduce the overall colors to 15 or 30 per line!\n\tMode (-m / --mode) to encode the pixel data via rle (run-length encoding) or as\n\traw, which is the default. To reduce the colors of the image per line, various\n\tconverters (-c / --converter) can be used. These can be configured in \"mtc.cfg\".\n\tAdditional defined are: \"iview\" for IrfanView, \"magick\" for ImageMagick.\n    \n    examples:\n\t  multicolor imagefile.png\n      multicolor graphic.gif -o multicolor.lua\n      multicolor pixels.png -c iview -o mydata.lua\n      multicolor colorful.gif -r 16 -o only16.lua\n      multicolor border.jpg -r 31 -b 255 127 64 -o frame.lua\n      multicolor truecol.png -m rle -o compress.lua\n      multicolor logo.gif -o overwriteme.lua -f\n\n\nFiles\n=====\n\n* **multicolor.py** (the converter itself)\n* **images/piggie_power_without_the_price.png** (example image (23960 colors), [original](https://demozoo.org/graphics/205191/) by [Bossman](https://demozoo.org/sceners/32053/)/[Rift](https://www.pouet.net/groups.php?which=11428))\n* **images/kittens.png** (example image (23704 colors), [original](https://demozoo.org/graphics/302070/) by [Evil](https://demozoo.org/sceners/5794/)/[Accession](https://www.pouet.net/groups.php?which=1004))\n* **images/dryad.png** (example image (17056 colors), [original](https://demozoo.org/graphics/266505/) by [Lycan](https://demozoo.org/sceners/21309/)/[LNX](https://www.pouet.net/groups.php?which=11760))\n* **images/gameboys.png** (example image (18538 colors), [original](https://commons.wikimedia.org/wiki/File:Chiptune-Setup-Game-Boys.jpg) by [Lucius Kwok](https://www.flickr.com/photos/luciuskwok/))\n* **images/replicaanxiety.png** (example image (16 indexed colors), [original](https://demozoo.org/graphics/3719/) by [Decca](https://demozoo.org/sceners/634/)/[Lego](https://www.pouet.net/groups.php?which=556))\n* **components/display16.lua** (the display-routine for 16 colors per line)\n* **components/display31.lua** (the display-routine for 31 colors per line)\n* **components/display.lua** (the display-routine for 16 or less indexed colors)\n* **components/rle-decoder16.lua** (the decoder when using rle-mode for 16 colors)\n* **components/rle-decoder31.lua** (the decoder when using rle-mode for 31 colors)\n* **components/rle-decoder.lua** (the decoder when using rle-mode for 16 or less indexed colors)\n\nDisclaimer\n==========\n\nThere is no warranty for the scripts or it's functionality, use it at your own risk.\n\nThe icon/logo consists of the [Sweetie 16](https://lospec.com/palette-list/sweetie-16)-palette © by [GrafxKid](https://grafxkid.tumblr.com/) \u0026 a [Shredder clipart](https://www.clipartmax.com/middle/m2H7N4d3G6N4b1H7_shredder-machine-icon-clipart-paper-office-shredders-shredder-machine-icon/) © by [Clipartmax](https://clipartmax.com/).\n\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/RiftTeam/multicolor/issues\n\n\nContributing\n============\n\nDevelopment of `mulTIColor` happens at GitHub: https://github.com/RiftTeam/multicolor\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRiftTeam%2Fmulticolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRiftTeam%2Fmulticolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRiftTeam%2Fmulticolor/lists"}