Giter Club home page Giter Club logo

batcher's Introduction

Batcher

Batcher is a GIMP plug-in for batch-exporting layers as separate images and batch-editing layers.

Batcher currently requires GIMP 2.99.18 (a development version as a precursor to GIMP 3.0). Earlier or later GIMP versions will not work.

What can Batcher do?

  • Export layers in any file format provided by GIMP and third-party plug-ins
  • Batch edit layers with any GIMP procedure or plug-in
  • Limit export/editing to layers matching constraints

Download latest release (0.4, July 13, 2024)

Installation and Usage

See the webpage.

Support

You can report issues, ask questions or request new features on the GitHub Issues page. Please check the current issues there before submitting a report.

License

Batcher is licensed under the BSD 3-Clause license.

batcher's People

Contributors

kamilburda avatar khalim19 avatar vinzv avatar ypid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

batcher's Issues

does this plugin work with the flatpak?

Excuse me, but does this plugin work with the flatpak and python 3.11?
I have download the zip, extracted it in the plugin's folder ( /home//.var/app/org.gimpGIMP/config/GIMP/2.99/plugins ) and I can't seem to get it to work... I wonder if their is anything that I missed?

Extend support for placeholders

To support use cases like "set layer offsets to 50% of image size", we need to provide additional placeholders, particularly for integer and float parameters. This way, the user has the option to specify a value which will be dynamically derived from the attributes of an object, e.g. image or layer width/height.

Conversely, one may want to apply a procedure on a specific layer or image rather than the currently processed layer/image.

In the GUI, we need to allow the user to toggle between the regular and the placeholder widgets when editing procedures/constraints.

Provide separate menus and dialogs for editing and exporting

The layer editing feature is hidden and new features are planned to be added as part of batch layer editing.

Also, Use layer size is only useful during export - using it during editing produces undesirable results as the image is resized for each layer.

Allow adding custom constraints

The GIMP PDB contains many procedures returning value(s), such as obtaining layer dimensions, whether the layer has an alpha channel, etc. This information could potentially be used as custom constraints, e.g. "layer width is less than 500 pixels". Generally speaking, the custom constraints should support operators applied on the procedure return values (equals, less than, greater than, etc.).

For greater flexibility, placeholders should be supported as described in #2.

The problem with supporting custom constraints is the fact that some plug-ins which modify layers destructively may also return values, meaning such constraints act like procedures when they are not meant to.

Additionally, it could be useful sometimes to combine multiple constraints (built-in or custom) with "OR" or "AND" operators of sorts, to create constraints like "layer width is less than 500 pixels OR layer height is less than 500 pixels".

Export Layers: Allow adjusting file format settings directly in plug-in

There could be a single button containing:

  • all settings available in the Export procedure (allowing multi-page export without adding the procedure, which is rather obscure)
  • settings for the file format currently typed in the file extension entry. This should be the new default and replace the native file format dialog, which can get hidden behind the plug-in dialog (a known GIMP issue). It can also be more convenient as it does not involve an extra step every time a plug-in setting is adjusted the re-export is performed. The native dialog can still be displayed if needed or must be displayed for unrecognized or interactive-only file formats.

batcher crashed on export in snapped GIMP 2.99.16

What went wrong?

Traceback (most recent call last):
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/pygimplib/procedure.py", line 373, in func_wrapper
    return_values = func(*procedure_and_args)
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/batcher.py", line 76, in plug_in_batch_export_layers_now
    return _run_export_layers_now_interactive(layer_tree)
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/batcher.py", line 170, in _run_export_layers_now_interactive
    gui_main.ExportLayersNowDialog(layer_tree, SETTINGS)
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/src/gui/main.py", line 1191, in __init__
    self.run_batcher()
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/src/gui/main.py", line 1235, in run_batcher
    self._batcher.run(
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/src/core.py", line 368, in run
    self._setup_contents()
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/src/core.py", line 866, in _setup_contents
    self._image_copy = pg.pdbutils.duplicate_image_without_contents(self._input_image)
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/pygimplib/pdbutils.py", line 37, in duplicate_image_without_contents
    pdb.gimp_image_set_unit(new_image, pdb.gimp_image_get_unit(image))
  File "/home/michal/snap/gimp/425/.config/GIMP/2.99/plug-ins/batcher/pygimplib/pypdb.py", line 121, in __call__
    result = self._proc.run(config)
TypeError: argument args: Expected Gimp.ValueArray, but got __gi__.GimpProcedureConfig-gimp-image-get-unit

If you can, tell us the steps to reproduce the problem.

$ snap install gimp --channel preview/stable
# install batcher in ~/snap/gimp/current/.config/GIMP/2.99/plug-ins
# try exporting layers

Configuration

Version of Batcher: 0.2

Version of GIMP: 2.99.16

Operating system: Ubuntu Noble Numbat (devel)

New feature: Batch processing (conversion) of files

To bring this plug-in one step closer to becoming a full-fledged batch processing tool, we should support batch image conversion. The user should be able to add files on the disk and/or images opened in GIMP and batch-convert them, saving them to the specified output folder with the specified image format.

We can reuse the existing codebase for adding procedures and constraints during processing. Those that are suitable only for layers and not entire images should be disabled/modified (e.g. Use layer size should not be available, Remove folder structure should work on folders rather than layer groups).

The user should be able to adjust import settings (depending on the input file format). This may be tricky to implement as the input images can have different file formats. The simplest solution is to allow displaying the native file format dialog for the first image per file format.

Allow to add actions with custom code

To achieve the ultimate flexibility, let users add custom code that acts as an action (procedure or constraint). This would be a more convenient way to specify custom code as opposed to a script/plug-in which requires additional boilerplate such as registration.

While interactively adding an action should be simple enough, it fails in case we need to specify conditions, set variables as arguments, etc.

While I don't see this to be particularly difficult to implement, executing arbitrary code written in Python can pose severe security risks.

A suggestion

Change export layers... to Batch export
And Export layer now to Quick export

Allow applying a procedure just once, at the start or end

This should be relatively easily doable as the code already internally uses several action groups - actions that are performed once at the start, once for each item (layer) and once at the end. The action group should be modifiable for each procedure separately - in the action edit dialog, this should be placed under More options.

Allow user to individualize settings for each layer

To allow greater flexibility, let the user to customize settings for each layer separately. For example, the user would want to enable a setting (e.g. "Autocrop") for all layers except one. While it could be done with some workarounds (e.g. export again with autocrop disabled), they are quite inconvenient. This information should be stored somewhere in the layers/image so as to preserve it between GIMP sessions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.