{"id":34997009,"url":"https://github.com/avian2/gimp-plugin-onion-layers","last_synced_at":"2025-12-27T02:17:29.044Z","repository":{"id":141975647,"uuid":"82718954","full_name":"avian2/gimp-plugin-onion-layers","owner":"avian2","description":"GIMP plug-in for convenient switching between frames in animations","archived":false,"fork":false,"pushed_at":"2022-12-28T18:42:35.000Z","size":392,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T13:06:10.508Z","etag":null,"topics":["gimp","gimp-plugin","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/avian2.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-02-21T19:33:31.000Z","updated_at":"2024-06-08T19:03:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"8cf57fcd-6ba3-49b0-932e-c2c4d82b5c49","html_url":"https://github.com/avian2/gimp-plugin-onion-layers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avian2/gimp-plugin-onion-layers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avian2%2Fgimp-plugin-onion-layers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avian2%2Fgimp-plugin-onion-layers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avian2%2Fgimp-plugin-onion-layers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avian2%2Fgimp-plugin-onion-layers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avian2","download_url":"https://codeload.github.com/avian2/gimp-plugin-onion-layers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avian2%2Fgimp-plugin-onion-layers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28069319,"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-12-27T02:00:05.897Z","response_time":58,"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":["gimp","gimp-plugin","python"],"created_at":"2025-12-27T02:17:28.694Z","updated_at":"2025-12-27T02:17:29.025Z","avatar_url":"https://github.com/avian2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GIMP onion layers plug-in\n\nOnion layers is a plug-in for the [GIMP](https://www.gimp.org/) drawing\nprogram. It provides some convenient shortcuts for moving up and down the stack\nof frames when making hand-drawn animations, as well as some other useful\nfunctions. It's based on the concept called *onion layering*, where the frame\nyou are currently working on is overlaid with the previous and next frames to\naid in drawing.\n\n![](figures/example.png)\n\nCurrently it provides the following functions that can be assigned to keyboard\nshortcuts:\n\n *  Switch to next/previous frame, optionally showing some neighboring frames.\n *  Cycle through showing no neighboring frames, only next frame, only previous\n    frame, or both next and previous frames.\n *  Show all frames will full opacity.\n\nSome other useful functions when drawing animations where each frame consists\nof multiple layers are also included:\n\n *  Copy a layer to all frames.\n *  Add a new frame, taking the layers in the current one as a template.\n\n\n## Installation\n\nTo install the plug-in, copy the `onion_layers.py` file to your plug-in\ndirectory. This might be `[your home folder]/.gimp-[GIMP version]/plug-ins` or\n`[your home folder]/.config/GIMP/[GIMP version]/plug-ins`. Check \"Edit -\u003e\nPreferences -\u003e Folders -\u003e Plug-ins\" if you're not sure.\n\nIf you have GIMP 2.10 on Linux, running `make install` should do the right\nthing. The plug-in will likely not work on Windows as-is (patches would be welcome)\n\nThe plug-in was developed for GIMP 2.10.8 and Python 2.7.16. It was known to\nwork on 2.8 in the past. It might also work with older or newer versions of\nGIMP - feedback regarding that is welcome.\n\n\n## Usage\n\nFunctions provided by the plug-in can be found in the GIMP menu under \"Filters\n-\u003e Animation -\u003e Onion layers\".\n\nYou want to assign keyboard shortcuts to them however. Go to \"Edit -\u003e Keyboard\nShortcuts\" and search for \"onion\". A good choice of shortcuts for previous/next\nframe functions are period and comma keys on a US keyboard. They shouldn't\nconflict with other GIMP shortcuts and match the frame skip shortcuts on some\nvideo players.\n\nFollowing shows the list of available functions as well as a suggestion on what\nkeys to assign to them:\n\n![](figures/keyboard-shortcuts.png)\n\nThe plug-in assumes that each top-level layer or layer group represents one\nanimation frame. You should have layers named consistently: top-level groups\nnamed \"frame0000\", \"frame0100\", etc. and then layers inside named using the same\npattern.\n\nThe layer on top of the stack is the *last* layer (same ordering is used for\nanimated GIF functions that are built into GIMP). Hence frame numbers are\ntypically shown in falling order in GIMP's Layers dialog.\n\nIf you have background layers that are common to all frames, you can put\n[brackets] around their names and they will be ignored by this plug-in. This is\nconsistent with how the [Export\nLayers](https://github.com/khalim19/gimp-plugin-export-layers) used to handle\nbackground layers.\n\nA good start is the setup shown below. You can also find some useful templates\nin the `template-720p.xcf` and `template-1080p.xcf` files included in the\nrepository:\n\n![](figures/starting-layers.png)\n\n\"[bg]\" contains the background, \"frame0000\" is the layer group representing\nthe first frame of the animation and \"sketch0000\" is the first layer in that\nframe. Draw something on \"sketch0000\" and then add a new frame by presssing \"C\"\n(`python-fu-onion-add-frame`). This should add \"frame0100\" and \"sketch0100\".\n\nBy numbering frames with 100, 200, 300, ... instead of 1, 2, 3, ... you can\nlater insert inbetween frames without renaming all your key frames. This might\nhelp you if you've already inserted your keyframes into some video editing\nsoftware.\n\nA file with more layers per frame may look like this. Each frame has an\noutline, a shading and a color layer:\n\n![](figures/layers.png)\n\n\n### Onion layer up/down functions\n\nThe `python-fu-onion-down-ctx-auto-tint` and `python-fu-onion-up-ctx-auto-tint`\nfunctions change the visibility and opacity of top-level layers or groups one\nstep up or down.\n\nThe currently active frame will be given full opacity, frames one step above\nand below in the stack (if shown) will be given 25% opacity. They will also be\nslightly tinted green (next) and purple (previous). Other layers will be hidden.\n\nThe active layer (the layer where the drawing tools have effect) will be\nchanged accordingly as well, if you are using the recommended layer naming scheme.\n\nThe tinting of layers is done by adding two layers to your image\n(\"onion-tint-before\", \"onion-tint-after\"). If you find that this makes GIMP too\nslow or you don't like tinting, you can use the identical functions without the\n\"-tint\" in their names.\n\nThe `python-fu-onion-up` and `python-fu-onion-down` functions work in the same\nway, except that they force the neighboring frames not to be shown. This is\nsometimes useful to quickly reduce clutter.\n\n\n### Selecting neighboring layer visibility\n\nThe `python-fu-onion-cycle-ctx-tint` function will cycle through the four possible\nsettings for the visibility of neighboring frames:\n\n *  No neighboring frames shown,\n *  both previous and next frames shown,\n *  only next frame shown and\n *  only previous frame shown.\n\nDisplay of neighboring frames gives best results when working on black outlines\non transparent background. If you have frames colored-in, it's best to not show\nneighboring frames.\n\nThe `python-fu-onion-cycle-ctx` function does the same thing, except it does\nnot use tinting layers.\n\n\n### Preparing frames for export\n\nThe `python-fu-onion-show-all` can be used to reset the visibility and opacity\nof all layers. This is useful before exporting the layers using *Export\nLayers*, since otherwise some frames might get exported with reduced opacity.\n\nThis function also cleans up the tinting layers.\n\n\n### Other useful things\n\n`python-fu-onion-copy-layer` will copy currently active layer to all frames. It\nwill rename the copies to keep the correct naming scheme.\n\nIf a layer with such a name already exists in a frame, it will only copy over\nopacity and visibility. Hence this function is useful both to add a layer to\nall frames as well as quickly show or hide a layer in all frames.\n\n`python-fu-onion-add-frame` will add a new frame above (i.e. appearing after)\nthe currently active one. The new frame will have a number between the two\nexisting frames. It will also create blank layers inside the new group, taking\nthe current frame as a template.\n\nIf there is no space for a new number (i.e. frames already have consecutive\nnumbers) it will refuse to do anything. You can renumber frames using\n`python-fu-onion-renumber-frames` to fix this.\n\n`python-fu-onion-copy-layer` and `python-fu-onion-add-frame` only work when\nframes are layer groups, not single frames.\n\n`python-fu-onion-convert-to-groups` will convert any top-level, non-background,\nbare layers into groups. This is useful after importing individual frames into\nGIMP using \"File -\u003e Open as Layers...\"\n\n`python-fu-onion-enable-frame` and `python-fu-onion-disable-frame` will make\nthe current frame a background layer and vice-versa. This is useful for quickly\nremoving and re-adding frames from and to the onion stack.\n\n`python-fu-onion-renumber-frames` will renumber all your layers. Use this if\nyou've run out of numbers for inbetweens.\n\n## Known problems\n\nIf `-up` and `-down` functions don't do anything, make sure that you have at\nleast one top-level layer or group visible and at 100% opacity.\n\nChanging layer visibility and opacity clutters the undo history. Unfortunately\nthere is no way for a plug-in to manipulate the undo history. The code makes\nsure to do its thing with as few undo steps as possible, but fundamentally this\nis a limitation of the GIMP plug-in interface.\n\n## License\n\nGIMP onion layers plug-in is Copyright (C) 2022 Tomaž Šolc tomaz.solc@tablix.org\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program.  If not, see http://www.gnu.org/licenses/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favian2%2Fgimp-plugin-onion-layers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favian2%2Fgimp-plugin-onion-layers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favian2%2Fgimp-plugin-onion-layers/lists"}