{"id":18666666,"url":"https://github.com/fhpythonutils/layeredimage","last_synced_at":"2026-03-03T18:01:46.509Z","repository":{"id":44718326,"uuid":"257650108","full_name":"FHPythonUtils/LayeredImage","owner":"FHPythonUtils","description":"Use this module to read, and write to a number of layered image formats","archived":false,"fork":false,"pushed_at":"2025-02-23T23:46:00.000Z","size":7280,"stargazers_count":12,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-16T05:10:02.666Z","etag":null,"topics":["apple-lsr","image-manipulation","layered-canvas","lsr","ora","pdn","psd","python","python3","tif","tiff","xcf"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FHPythonUtils.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2020-04-21T16:27:47.000Z","updated_at":"2025-02-23T23:46:03.000Z","dependencies_parsed_at":"2024-01-19T20:47:58.141Z","dependency_job_id":"8fb1b756-1129-4a46-b4e8-b42c325c4beb","html_url":"https://github.com/FHPythonUtils/LayeredImage","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"61cbf63c589a3bccbc3d7efdbd3616cdcd100568"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/FHPythonUtils/LayeredImage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FHPythonUtils%2FLayeredImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FHPythonUtils%2FLayeredImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FHPythonUtils%2FLayeredImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FHPythonUtils%2FLayeredImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FHPythonUtils","download_url":"https://codeload.github.com/FHPythonUtils/LayeredImage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FHPythonUtils%2FLayeredImage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266824125,"owners_count":23990162,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["apple-lsr","image-manipulation","layered-canvas","lsr","ora","pdn","psd","python","python3","tif","tiff","xcf"],"created_at":"2024-11-07T08:33:31.122Z","updated_at":"2026-03-03T18:01:41.466Z","avatar_url":"https://github.com/FHPythonUtils.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub top language](https://img.shields.io/github/languages/top/FHPythonUtils/LayeredImage.svg?style=for-the-badge\u0026cacheSeconds=28800)](../../)\n[![Issues](https://img.shields.io/github/issues/FHPythonUtils/LayeredImage.svg?style=for-the-badge\u0026cacheSeconds=28800)](../../issues)\n[![License](https://img.shields.io/github/license/FHPythonUtils/LayeredImage.svg?style=for-the-badge\u0026cacheSeconds=28800)](/LICENSE.md)\n[![Commit activity](https://img.shields.io/github/commit-activity/m/FHPythonUtils/LayeredImage.svg?style=for-the-badge\u0026cacheSeconds=28800)](../../commits/master)\n[![Last commit](https://img.shields.io/github/last-commit/FHPythonUtils/LayeredImage.svg?style=for-the-badge\u0026cacheSeconds=28800)](../../commits/master)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/layeredimage.svg?style=for-the-badge\u0026cacheSeconds=28800)](https://pypistats.org/packages/layeredimage)\n[![PyPI Total Downloads](https://img.shields.io/badge/dynamic/json?style=for-the-badge\u0026label=total%20downloads\u0026query=%24.total_downloads\u0026url=https%3A%2F%2Fapi%2Epepy%2Etech%2Fapi%2Fv2%2Fprojects%2Flayeredimage)](https://pepy.tech/project/layeredimage)\n[![PyPI Version](https://img.shields.io/pypi/v/layeredimage.svg?style=for-the-badge\u0026cacheSeconds=28800)](https://pypi.org/project/layeredimage)\n\n\u003c!-- omit in toc --\u003e\n# LayeredImage\n\n\u003cimg src=\"readme-assets/icons/name.png\" alt=\"Project Icon\" width=\"750\"\u003e\n\nUse this module to read, and write to a number of layered image formats\n\n- [Compatibility](#compatibility)\n\t- [Overview](#overview)\n\t\t- [Key](#key)\n\t\t- [Reading - Group](#reading---group)\n\t\t- [Reading - Layer](#reading---layer)\n\t\t- [Writing - Group](#writing---group)\n\t\t- [Writing - Layer](#writing---layer)\n- [.layered](#layered)\n- [Example Usage](#example-usage)\n- [Documentation](#documentation)\n- [Install With PIP](#install-with-pip)\n- [Language information](#language-information)\n\t- [Built for](#built-for)\n- [Install Python on Windows](#install-python-on-windows)\n\t- [Chocolatey](#chocolatey)\n\t- [Windows - Python.org](#windows---pythonorg)\n- [Install Python on Linux](#install-python-on-linux)\n\t- [Apt](#apt)\n\t- [Dnf](#dnf)\n- [Install Python on MacOS](#install-python-on-macos)\n\t- [Homebrew](#homebrew)\n\t- [MacOS - Python.org](#macos---pythonorg)\n- [How to run](#how-to-run)\n\t- [Windows](#windows)\n\t- [Linux/ MacOS](#linux-macos)\n- [Building](#building)\n- [Testing](#testing)\n- [Download Project](#download-project)\n\t- [Clone](#clone)\n\t\t- [Using The Command Line](#using-the-command-line)\n\t\t- [Using GitHub Desktop](#using-github-desktop)\n\t- [Download Zip File](#download-zip-file)\n- [Community Files](#community-files)\n\t- [Licence](#licence)\n\t- [Changelog](#changelog)\n\t- [Code of Conduct](#code-of-conduct)\n\t- [Contributing](#contributing)\n\t- [Security](#security)\n\t- [Support](#support)\n\t- [Rationale](#rationale)\n\n## Compatibility\n\nBear in mind that the tables below may not be completely accurate. If that is\nthe case, please open an issue and I will fix the tables.\n\n### Overview\n\n#### Key\n\n- ✔ - Supported\n- ⚠ - Things will look the same, but data is lost\n- ❌ - This is not supported and will cause loss of data\n- N/A - The source format does not support this so treat this as a ✔\n\n| Format | .ora               | .pdn               | .xcf               | .psd               | .tiff/ .tif        | .webp              | .gif               | .lsr               |\n| ------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |\n| Read   | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 |\n| Layers | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 |\n| Groups | ✔                 | N/A                | ✔                 | ✔                 | N/A                | N/A                | N/A                | ✔                 |\n| Write  | ✔                 | ❌                | ❌                | ❌                | ⚠                 | ⚠                 | ⚠                 | ✔                 |\n\n#### Reading - Group\n\n| Format     | .ora               | .pdn | .xcf               | .psd               | .tiff/ .tif | .webp | .gif | .lsr               |\n| ---------- | ------------------ | ---- | ------------------ | ------------------ | ----------- | ----- | ---- | ------------------ |\n| Name       | ✔                 | N/A  | ✔                 | ✔                 | N/A         | N/A   | N/A  | ✔                 |\n| Dimensions | ⚠                 | N/A  | ✔                 | ✔                 | N/A         | N/A   | N/A  | ✔                 |\n| Offsets    | ✔                 | N/A  | ✔                 | ✔                 | N/A         | N/A   | N/A  | ✔                 |\n| Opacity    | ✔                 | N/A  | ✔                 | ✔                 | N/A         | N/A   | N/A  | N/A                |\n| Visibility | ✔                 | N/A  | ✔                 | ✔                 | N/A         | N/A   | N/A  | N/A                |\n| Blend Mode | ✔                 | N/A  | ✔                 | ✔                 | N/A         | N/A   | N/A  | N/A                |\n\n#### Reading - Layer\n\n| Format     | .ora               | .pdn               | .xcf               | .psd               | .tiff/ .tif        | .webp              | .gif               | .lsr               |\n| ---------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |\n| Name       | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ⚠                 | ⚠                 | ✔                 |\n| Dimensions | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 | ✔                 |\n| Offsets    | ✔                 | N/A                | ✔                 | ✔                 | ✔                 | N/A                | N/A                | N/A                |\n| Opacity    | ✔                 | ✔                 | ✔                 | ✔                 | N/A                | N/A                | N/A                | N/A                |\n| Visibility | ✔                 | ✔                 | ✔                 | ✔                 | N/A                | N/A                | N/A                | N/A                |\n| Blend Mode | ✔                 | ✔                 | ✔                 | ✔                 | N/A                | N/A                | N/A                | N/A                |\n\n#### Writing - Group\n\n| Format     | .ora               | .pdn | .xcf | .psd | .tiff/ .tif | .webp     | .gif      | .lsr               |\n| ---------- | ------------------ | ---- | ---- | ---- | ----------- | --------- | --------- | ------------------ |\n| Name       | ✔                 | ❌  | ❌  | ❌  | ❌         | ❌       | ❌       | ✔                 |\n| Dimensions | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ✔                 |\n| Offsets    | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ✔                 |\n| Opacity    | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ⚠                 |\n| Visibility | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ⚠                 |\n| Blend Mode | ✔                 | ❌  | ❌  | ❌  | ❌         | ❌       | ❌       | ❌                |\n\n```none\nLayers are extracted from groups and saved to TIFF/ GIF or WEBP\n```\n\n#### Writing - Layer\n\n| Format     | .ora               | .pdn | .xcf | .psd | .tiff/ .tif | .webp     | .gif      | .lsr      |\n| ---------- | ------------------ | ---- | ---- | ---- | ----------- | --------- | --------- | --------- |\n| Name       | ✔                 | ❌  | ❌  | ❌  | ❌         | ❌       | ❌       | ⚠        |\n| Dimensions | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ⚠        |\n| Offsets    | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ⚠        |\n| Opacity    | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ⚠        |\n| Visibility | ✔                 | ❌  | ❌  | ❌  | ⚠          | ⚠        | ⚠        | ⚠        |\n| Blend Mode | ✔                 | ❌  | ❌  | ❌  | ❌         | ❌       | ❌       | ❌       |\n\n```none\nLayers are rendered with offsets before being written to TIFF/ GIF or WEBP\nFirst child layers are placed in a group when written to LSR\n```\n\n## .layered\n\n.layered is highly inspired by the open raster format and aims to provide an\nexchange format in the cases when saving in ora would cause unacceptable data\nloss. .layered has been designed so that if the format became deprecated and no\nreaders existed for it tomorrow, the data would be easily salvageable.\n\nSee the [LAYERED_SPEC](/LAYERED_SPEC.md) for more information.\n\n## Example Usage\n\nHere's some basic example usage below.\n\n```python\n\"\"\"Example module \"\"\"\nfrom pathlib import Path\nTHISDIR = str(Path(__file__).resolve().parent)\nimport layeredimage.io\n\n# Do stuff\nora = layeredimage.io.openLayerImage(f\"{THISDIR}/image.ora\")\n\nimageDimensions = ora.dimensions\n# There are a load of handy functions for getting layers, and adding new\n# layers, but here we will act directly on the object\nlayer = ora.layersAndGroups[0] # For the sake of the e.g. this is a layer\n\n# Lets overwrite the layer with a transparent image (bit boring I know...)\nlayer.image = Image.new(\"RGBA\", imageDimensions)\nora.layersAndGroups[0] = layer\n\n# And let's save\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/image(modified).ora\", ora)\n\n# Let's save a flattened version too\nora.getFlattenLayers().save(f\"{THISDIR}/image(modified).png\")\n\n# Doing stuff with a group\ngroup = ora.getLayerOrGroup(1) # For the sake of the e.g. this is a group\ngroup.layers[0].image.show() # Open the image of the first layer of the group\n\n# Deleting a layer/ group\nora.removeLayerOrGroup(2)\n```\n\nImages are PIL.Image (s) and so you can use the power of Pillow to apply\nfilters, and other modifications to the images.\n\nSee below for an old version of the tests. These provide a few examples of\nfile conversions. Not going to get 100% coverage anytime soon but hopefully\nthis will help a little.\n\n```python\n\"\"\"Test module \"\"\"\n\nimport sys\nimport os\nfrom pathlib import Path\nTHISDIR = str(Path(__file__).resolve().parent)\nsys.path.insert(0, os.path.dirname(THISDIR))\nimport layeredimage.io\n\n# ORA\nora = layeredimage.io.openLayerImage(f\"{THISDIR}/base24.ora\")\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(ora).ora\", ora)\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(ora).tiff\", ora)\nora.getFlattenLayers().save(f\"{THISDIR}/base24(ora).png\")\n\n# PSD\npsd = layeredimage.io.openLayerImage(f\"{THISDIR}/base24.psd\")\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(psd).ora\", psd)\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(psd).tiff\", psd)\npsd.getFlattenLayers().save(f\"{THISDIR}/base24(psd).png\")\n\n# PDN\npdn = layeredimage.io.openLayerImage(f\"{THISDIR}/base24.pdn\")\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(pdn).ora\", pdn)\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(pdn).tiff\", pdn)\npdn.getFlattenLayers().save(f\"{THISDIR}/base24(pdn).png\")\n\n# XCF\nxcf = layeredimage.io.openLayerImage(f\"{THISDIR}/base24.xcf\")\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(xcf).ora\", xcf)\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(xcf).tiff\", xcf)\nxcf.getFlattenLayers().save(f\"{THISDIR}/base24(xcf).png\")\n\n# TIFF\ntiff = layeredimage.io.openLayerImage(f\"{THISDIR}/base24.tiff\")\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(tiff).ora\", tiff)\nlayeredimage.io.saveLayerImage(f\"{THISDIR}/base24(tiff).tiff\", tiff)\ntiff.getFlattenLayers().save(f\"{THISDIR}/base24(tiff).png\")\n```\n\n## Documentation\n\nA high-level overview of how the documentation is organized organized will help you know\nwhere to look for certain things:\n\n\u003c!--\n- [Tutorials](/documentation/tutorials) take you by the hand through a series of steps to get\n  started using the software. Start here if you’re new.\n--\u003e\n- The [Technical Reference](/documentation/reference) documents APIs and other aspects of the\n  machinery. This documentation describes how to use the classes and functions at a lower level\n  and assume that you have a good high-level understanding of the software.\n\u003c!--\n- The [Help](/documentation/help) guide provides a starting point and outlines common issues that you\n  may have.\n--\u003e\n\n## Install With PIP\n\n```python\npip install layeredimage\n```\n\nHead to https://pypi.org/project/layeredimage/ for more info\n\n## Language information\n\n### Built for\n\nThis program has been written for Python versions 3.8 - 3.11 and has been tested with both 3.8 and\n3.11\n\n## Install Python on Windows\n\n### Chocolatey\n\n```powershell\nchoco install python\n```\n\n### Windows - Python.org\n\nTo install Python, go to https://www.python.org/downloads/windows/ and download the latest\nversion.\n\n## Install Python on Linux\n\n### Apt\n\n```bash\nsudo apt install python3.x\n```\n\n### Dnf\n\n```bash\nsudo dnf install python3.x\n```\n\n## Install Python on MacOS\n\n### Homebrew\n\n```bash\nbrew install python@3.x\n```\n\n### MacOS - Python.org\n\nTo install Python, go to https://www.python.org/downloads/macos/ and download the latest\nversion.\n\n## How to run\n\n### Windows\n\n- Module\n\t`py -3.x -m [module]` or `[module]` (if module installs a script)\n\n- File\n\t`py -3.x [file]` or `./[file]`\n\n### Linux/ MacOS\n\n- Module\n\t`python3.x -m [module]` or `[module]` (if module installs a script)\n\n- File\n\t`python3.x [file]` or `./[file]`\n\n## Building\n\nThis project uses https://github.com/FHPythonUtils/FHMake to automate most of the building. This\ncommand generates the documentation, updates the requirements.txt and builds the library artefacts\n\nNote the functionality provided by fhmake can be approximated by the following\n\n```sh\nhandsdown  --cleanup -o documentation/reference\npoetry export -f requirements.txt --output requirements.txt\npoetry export -f requirements.txt --with dev --output requirements_optional.txt\npoetry build\n```\n\n`fhmake audit` can be run to perform additional checks\n\n## Testing\n\nFor testing with the version of python used by poetry use\n\n```sh\npoetry run pytest\n```\n\nAlternatively use `tox` to run tests over python 3.8 - 3.11\n\n```sh\ntox\n```\n\n## Download Project\n\n### Clone\n\n#### Using The Command Line\n\n1. Press the Clone or download button in the top right\n2. Copy the URL (link)\n3. Open the command line and change directory to where you wish to\nclone to\n4. Type 'git clone' followed by URL in step 2\n\n\t```bash\n\tgit clone https://github.com/FHPythonUtils/LayeredImage\n\t```\n\nMore information can be found at\nhttps://help.github.com/en/articles/cloning-a-repository\n\n#### Using GitHub Desktop\n\n1. Press the Clone or download button in the top right\n2. Click open in desktop\n3. Choose the path for where you want and click Clone\n\nMore information can be found at\nhttps://help.github.com/en/desktop/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop\n\n### Download Zip File\n\n1. Download this GitHub repository\n2. Extract the zip archive\n3. Copy/ move to the desired location\n\n## Community Files\n\n### Licence\n\nMIT License\nCopyright (c) FredHappyface\n(See the [LICENSE](/LICENSE.md) for more information.)\n\n### Changelog\n\nSee the [Changelog](/CHANGELOG.md) for more information.\n\n### Code of Conduct\n\nOnline communities include people from many backgrounds. The *Project*\ncontributors are committed to providing a friendly, safe and welcoming\nenvironment for all. Please see the\n[Code of Conduct](https://github.com/FHPythonUtils/.github/blob/master/CODE_OF_CONDUCT.md)\n for more information.\n\n### Contributing\n\nContributions are welcome, please see the\n[Contributing Guidelines](https://github.com/FHPythonUtils/.github/blob/master/CONTRIBUTING.md)\nfor more information.\n\n### Security\n\nThank you for improving the security of the project, please see the\n[Security Policy](https://github.com/FHPythonUtils/.github/blob/master/SECURITY.md)\nfor more information.\n\n### Support\n\nThank you for using this project, I hope it is of use to you. Please be aware that\nthose involved with the project often do so for fun along with other commitments\n(such as work, family, etc). Please see the\n[Support Policy](https://github.com/FHPythonUtils/.github/blob/master/SUPPORT.md)\nfor more information.\n\n### Rationale\n\nThe rationale acts as a guide to various processes regarding projects such as\nthe versioning scheme and the programming styles used. Please see the\n[Rationale](https://github.com/FHPythonUtils/.github/blob/master/RATIONALE.md)\nfor more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhpythonutils%2Flayeredimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffhpythonutils%2Flayeredimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhpythonutils%2Flayeredimage/lists"}