bgrabitmap / lazpaint

🎨 Cross-platform image editor with raster and vector layers similar to Paint.Net written in Lazarus (Free Pascal)
https://lazpaint.github.io/
GNU General Public License v3.0
406 stars 56 forks source link

Batch Processing #115

Open lainz opened 4 years ago

lainz commented 4 years ago

A dialog that has this features:

For example, you add an entire folder of images, choose a python script to execute to these images, and an output folder. Execute button will process all images with that script, when the script finishes it saves a copy of the processed image.

Like for example: do resample a folder with .png images to 50% of its width and height and save as .jpg (like for creating thumbnails). Another use can just be no script and just change file format for all images in a folder.

circular17 commented 4 years ago

Good idea

lainz commented 4 years ago

Thanks. I've used that feature a lot of times in Corel Draw, here a small tutorial and screenshots https://www.coreldraw.com/en/tips/photo/bulk-edits/batch-resize-images/

circular17 commented 4 years ago

I wonder if this could be added to the image list. It is a bit the same idea.

circular17 commented 4 years ago

I've added script support for image list. So one can use that to make a script to process many files: https://github.com/bgrabitmap/lazpaint/blob/dev-lazpaint/scripts/test/test_imagelist.py

A minimal script to apply on the files currently in the image list would be:

from lazpaint import imagelist, image
for filename in imagelist.iterate(True):
  new_filename = image.change_file_extension(filename, "png")
  image.export(file_name=new_filename, validate=True, overwrite=False, skip_options=True)

Also one can run a script from command line, for example: ./lazpaint ~/Images/some_image.jpg -script some_script.py

circular17 commented 4 years ago

I leave the ticket open because the window for doing that would be a nice addition.

lainz commented 4 years ago

Ok Thanks