{"id":24405124,"url":"https://github.com/mrglaster/hl-hud-upscaler","last_synced_at":"2025-04-30T14:28:02.974Z","repository":{"id":272813609,"uuid":"917833382","full_name":"mrglaster/hl-hud-upscaler","owner":"mrglaster","description":"A utility for generating .spr and .txt weapon sprite files to support higher resolutions. Compatible with both the 25th Anniversary client version and pre-anniversary versions.","archived":false,"fork":false,"pushed_at":"2025-01-18T17:43:25.000Z","size":22,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T14:27:51.362Z","etag":null,"topics":["amx","amxmodx","amxx","colortrans","command-line-tool","half-life","hl","pillow","python","python3","spr","sprite","sprites","txt","upscale","upscaling","valve","weaponmod","wpnmod"],"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/mrglaster.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":"2025-01-16T18:21:07.000Z","updated_at":"2025-01-19T14:39:58.000Z","dependencies_parsed_at":"2025-01-16T20:00:59.660Z","dependency_job_id":"8833f3e1-5e6a-40da-9779-5631936ec251","html_url":"https://github.com/mrglaster/hl-hud-upscaler","commit_stats":null,"previous_names":["mrglaster/hl-hud-upscaler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrglaster%2Fhl-hud-upscaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrglaster%2Fhl-hud-upscaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrglaster%2Fhl-hud-upscaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrglaster%2Fhl-hud-upscaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrglaster","download_url":"https://codeload.github.com/mrglaster/hl-hud-upscaler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721132,"owners_count":21632772,"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":["amx","amxmodx","amxx","colortrans","command-line-tool","half-life","hl","pillow","python","python3","spr","sprite","sprites","txt","upscale","upscaling","valve","weaponmod","wpnmod"],"created_at":"2025-01-20T04:17:39.675Z","updated_at":"2025-04-30T14:28:02.934Z","avatar_url":"https://github.com/mrglaster.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Half-Life Weapon Sprites HUD Upscaler \n\n### Overview\n\nThe Half-Life 25th Anniversary update introduced support for higher screen resolutions. However, to properly display weapon sprites in the updated HUD, the associated `.spr` and `.txt` files must be updated. Without these updates, the sprites may appear distorted or misaligned.\n\nThis utility automates the process of generating updated `.spr` and `.txt` files, ensuring compatibility with the new resolution support and streamlining the workflow.\n\n#### weapon_357.txt before 25th anniversary update \n\n```\n12\nweapon         320 320hud1   0   80   80   20\nweapon_s      320 320hud1   0   100   80   20\nammo         320 320hud2   18   16   18   18\ncrosshair      320 crosshairs   48   0   24   24\nautoaim         320 crosshairs   24   72   24   24\nzoom         320 crosshairs   96   0   24   24\nweapon         640 640hud1   0   90   170   45\nweapon_s      640 640hud4   0   90   170   45\nammo         640 640hud7   24   72   24   24\ncrosshair      640 crosshairs   48   0   24   24\nautoaim         640 crosshairs   24   72   24   24\nzoom         640 crosshairs   96   0   24   24\n```\n\n#### weapon_357.txt after 25th anniversary update\n\n```\n24\nweapon         2560 2560/weapon_357_weapon   0   0   510   135\nweapon_s      2560 2560/weapon_357_weapon_s   0   0   510   135\nammo         2560 2560/weapon_357_ammo   0   0   72   72\ncrosshair      2560 2560crosshairs   144   0   72   72\nautoaim         2560 2560crosshairs   72   216   72   72\nzoom         2560 2560crosshairs   288   0   72   72\nweapon         1280 1280/weapon_357_weapon   0   0   340   90\nweapon_s      1280 1280/weapon_357_weapon_s   0   0   340   90\nammo         1280 1280/weapon_357_ammo   0   0   48   48\ncrosshair      1280 1280crosshairs   96   0   48   48\nautoaim         1280 1280crosshairs   48   144   48   48\nzoom         1280 1280crosshairs   192   0   48   48\nweapon         640 640hud1   0   90   170   45\nweapon_s      640 640hud4   0   90   170   45\nammo         640 640hud7   24   72   24   24\ncrosshair      640 crosshairs   48   0   24   24\nautoaim         640 crosshairs   24   72   24   24\nzoom         640 crosshairs   96   0   24   24\nweapon         320 320hud1   0   80   80   20\nweapon_s      320 320hud1   0   100   80   20\nammo         320 320hud2   18   16   18   18\ncrosshair      320 crosshairs   48   0   24   24\nautoaim         320 crosshairs   24   72   24   24\nzoom         320 crosshairs   96   0   24   24\n```\n\n\n---\n\n### Environment Setup\n\nFollow these steps to configure the environment for the utility:\n\n1. Install **Python 3**.\n2. Clone the repository or download the contents as a compressed archive and extract them.\n3. Install the required Python packages by running:\n\n   ```bash\n   pip3 install -r requirements.txt\n   ```\n4. The utility can automatically use paths to the standard highres sprites for ammo and crosshairs added in the HL25th Anniversary Update (it will be done if your sprite uses their default versions in resolution 640). To avoid issues, make sure to add them to the server's precache.\n5. Configuration is complete! You are now ready to use the utility.\n\n---\n\n### Usage Instructions\n\n1. Place all the required `.spr` and `.txt` files in a **single directory** (see example below):\n\n   ![Directory Structure](https://github.com/user-attachments/assets/736e3b68-8263-4fa8-80db-0803cf9b9305)\n\n2. Run the utility using the following command:\n\n   ```bash\n   python3 hud_upscaler.py --path /path/to/directory/with/your/weapon/sprites --umodel edsr-base\n   ```\n\n#### Command Line Arguments:\n\n- **`--path`**: The path to the directory containing your `.spr` and `.txt` files.\n- **`--umodel`**: The name of the upscaling model to use.  \n  You can find the list of available models [here](https://pypi.org/project/super-image/) or in the table below:\n\n   ![Model List](https://github.com/user-attachments/assets/1d7f80ae-0e2c-44fc-ad7d-9359193497b3)\n\n---\n\n### Comparation \n\n#### Weaponmod gun before the utlity was used\n\n![Before Update](https://github.com/user-attachments/assets/b6e0a7e4-c97e-4a2d-82e2-855199d7deb4)\n\n#### Weaponmod gun after the utlity was used\n\n![After Update](https://github.com/user-attachments/assets/d2a4cd4a-1d05-411f-bcf1-99a85c8c2971)\n\n### Links \n\n- https://github.com/ValveSoftware/halflife/blob/master/devtools/image_to_spr.py\n- https://developer.valvesoftware.com/wiki/SPR\n- https://twhl.info/wiki/page/hud.txt_and_weapon_*.txt\n- http://infotex58.ru/forum/index.php?topic=1135.0\n- https://pypi.org/project/super-image/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrglaster%2Fhl-hud-upscaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrglaster%2Fhl-hud-upscaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrglaster%2Fhl-hud-upscaler/lists"}