{"id":26952731,"url":"https://github.com/yoyoberenguer/pythonfirefx","last_synced_at":"2026-01-16T00:48:13.429Z","repository":{"id":57457010,"uuid":"440941168","full_name":"yoyoberenguer/PythonFireFx","owner":"yoyoberenguer","description":"Python procedural fire effect","archived":false,"fork":false,"pushed_at":"2023-02-27T19:06:20.000Z","size":23692,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-08T17:18:46.022Z","etag":null,"topics":["2d","2d-graphics","fire","fire-algorithm","fire-effect","image-processing","pygame","python-fire","shader"],"latest_commit_sha":null,"homepage":"","language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoyoberenguer.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":"2021-12-22T17:52:14.000Z","updated_at":"2023-02-27T19:07:04.000Z","dependencies_parsed_at":"2022-09-15T13:01:31.738Z","dependency_job_id":null,"html_url":"https://github.com/yoyoberenguer/PythonFireFx","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/yoyoberenguer%2FPythonFireFx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyoberenguer%2FPythonFireFx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyoberenguer%2FPythonFireFx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoyoberenguer%2FPythonFireFx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoyoberenguer","download_url":"https://codeload.github.com/yoyoberenguer/PythonFireFx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246916738,"owners_count":20854511,"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":["2d","2d-graphics","fire","fire-algorithm","fire-effect","image-processing","pygame","python-fire","shader"],"created_at":"2025-04-03T00:31:19.909Z","updated_at":"2026-01-16T00:48:13.417Z","avatar_url":"https://github.com/yoyoberenguer.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PythonFireFx\r\n\r\n\u003cp align=\"center\"\u003e\r\n    \u003cimg src=\"https://github.com/yoyoberenguer/PythonFireFx/blob/main/fire.gif?raw=true\"\u003e\r\n\u003c/p\u003e\r\n\r\n\r\nPythonFireFx is a shader for rendering 2D realistic fire effect (procedural fire).\r\nWritten in `python`, `cython` and `C` languages.It is design for \r\n`real time rendering` on pygame surface with screen resolution up\r\nto `1280 x 1024 pixels`. \r\n\r\nCompatible with image format 24-32 bit with any of the following extension:\r\nBMP, GIF (non - animated), JPEG, PNG image format.\r\n\r\nIt was originally designed for 2D video games application build on\r\ntop of Pygame library, but it can also be used as a plugin for \r\n`video` or `webcam special effect`. It requires few libraries in order \r\nto work, please see the dependency section for more details.\r\n\r\nThe algorithm has numerous options to control the fire envelop/aspect.\r\nAll this options can be defined as static or dynamic in order to \r\nproduce a more realistic fire effect:\r\n\r\n`Some of the options :` \r\n- Blur algorithm (to smooth and produce a warm /fluid fire effect)\r\n- Palette (pre-defined color wavelength's values set in a numpy array)\r\n- Smoothing effect to add a realistic touch\r\n- Fire intensity to control the fire energy at the base\r\n- Bloom effect to create local flickering light effect or add texture \r\n  volume to the fire (depends on the bright pass filter value) \r\n- Brightness control (fine control that change \r\n  the fire volume and intensity)\r\n- The palette can be disregarded, and a default palette can be used with \r\n  colors defined by HSL (hue, saturation and luminescence values) that can \r\n  also be set dynamically to change the colors overtime\r\n- Border flames (option to burn only the side of the screen/texture). This \r\n  option is designed to work with symmetrical surface (same width and height)\r\n\r\n## Tested under windows x64 platform.\r\n\r\n * Please feel free to open a new ticket if you wish to add any suggestion(s) or \r\n   if you wish to report a bug.\r\n\r\n## python method hook\r\n\r\n```python\r\nshader_fire_effect(\r\n        width_,\r\n        height_,\r\n        factor_,\r\n        palette_,\r\n        fire_\r\n)\r\n```\r\n`Optional arguments`\r\n```python\r\n        reduce_factor_        = 3,\r\n        fire_intensity_       = 32,\r\n        smooth_               = True,\r\n        bloom_                = True,\r\n        fast_bloom_           = True,\r\n        bpf_threshold_        = 0,\r\n        low_                  = 0,\r\n        high_                 = 600,\r\n        brightness_           = True,\r\n        brightness_intensity_ = 0.15,\r\n        surface_              = None,\r\n        adjust_palette_       = False,\r\n        hsl_                  = (10, 80, 1.8),\r\n        transpose_            = False,\r\n        border_               = False,\r\n        blur_                 = True\r\n```\r\n\r\n## doc \r\n`Read the Documentation in the folder Doc/html/index.html`\r\n\r\n![fire effect image](PythonFireFx/Assets/FireImage.PNG)\r\n\r\n## Demo\r\n\r\nIn the main directory run the below command \r\n\r\n`(press ESC to quit the demo)`\r\n\r\n```commandline\r\nC:\\\u003epython demo_fire.py\r\n```\r\n\r\nThe project is under the `GNU GENERAL PUBLIC LICENSE Version 3`\r\n\r\n## Installation \r\ncheck the link for newest version https://pypi.org/project/PythonFireFx/\r\n\r\n* Available python build 3.6, 3.7, 3.8, 3.9, 3.10 and source build\r\n```\r\npip install PythonFireFx \r\n```\r\n\r\n`Building project from source`\r\n```commandline\r\npython setup.py build\r\npython setup.py install\r\n```\r\n\r\n## Building cython code\r\n\r\n#### When do you need to compile the cython code ? \r\n\r\nEach time you are modifying any of the following files \r\nFireFx.pyx, FireFx.pxd, __init__.pxd or any external C code if applicable\r\n\r\n1) open a terminal window\r\n2) Go in the main project directory where (FireFx.pyx \u0026 \r\n   FireFx.pxd files are located)\r\n3) run : `C:\\\u003epython setup_FireFx.py build_ext --inplace --force`\r\n\r\nIf you have to compile the code with a specific python \r\nversion, make sure to reference the right python version \r\nin (`python38 setup_FireFx.py build_ext --inplace`)\r\n\r\nIf the compilation fail, refers to the requirement section and \r\nmake sure cython and a C-compiler are correctly install on your\r\n system.\r\n- A compiler such visual studio, MSVC, CGYWIN setup correctly on \r\n  your system.\r\n  - a C compiler for windows (Visual Studio, MinGW etc) install \r\n  on your system and linked to your windows environment.\r\n  Note that some adjustment might be needed once a compiler is \r\n  install on your system, refer to external documentation or \r\n  tutorial in order to setup this process.e.g https://devblogs.\r\n  microsoft.com/python/unable-to-find-vcvarsall-bat/\r\n\r\n## OPENMP \r\nIn the main project directory, locate the file ```setup_FireFx.py```.\r\nThe compilation flag /openmp is used by default.\r\nTo override the OPENMP feature and disable the multi-processing remove the flag ```/openmp```\r\n\r\n####\r\n```setup_FireFx.py```\r\n```python\r\n\r\nextra_compile_args = [\"/openmp\", \"/Qpar\", \"/fp:fast\", \"/O2\", \"/Oy\", \"/Ot\"]\r\n```\r\nSave the change and build the cython code with the following instruction:\r\n\r\n```python setup_FireFx.py build_ext --inplace --force```\r\n\r\nIf the project build successfully, the compilation will end up with the following lines\r\n```\r\nGenerating code\r\nFinished generating code\r\n```\r\nIf you have any compilation error refer to the section ```Building cython code```, make sure \r\nyour system has the following program \u0026 libraries installed. Check also that the code is not \r\nrunning in a different thread.  \r\n- Pygame version \u003e 3\r\n- numpy \u003e= 1.18\r\n- cython \u003e=0.29.21 (C extension for python) \r\n- A C compiler for windows (Visual Studio, MinGW etc)\r\n\r\n## Credit\r\nYoann Berenguer \r\n\r\n## Dependencies :\r\n```\r\nnumpy \u003e= 1.18\r\npygame \u003e=2.0.0\r\ncython \u003e=0.29.21\r\n```\r\n\r\n## License :\r\n\r\nGNU GENERAL PUBLIC LICENSE Version 3\r\n\r\nCopyright (c) 2019 Yoann Berenguer\r\n\r\nCopyright (C) 2007 Free Software Foundation, Inc. \u003chttps://fsf.org/\u003e\r\nEveryone is permitted to copy and distribute verbatim copies\r\nof this license document, but changing it is not allowed.\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyoberenguer%2Fpythonfirefx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoyoberenguer%2Fpythonfirefx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoyoberenguer%2Fpythonfirefx/lists"}