naps2 icon indicating copy to clipboard operation
naps2 copied to clipboard

[Feature Request] API / hooks / plugins for processing images with external tools

Open AltoRetrato opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I miss some functionality on NAPS2 (and honestly, most of other scanning apps) that I believe I (and others) could implement with a script call right before or after NAPS2 is done with its business (scanning, saving PDF files, etc.) - or even completely replacing NAPS native functions.

For instance, instead of using a fixed brightness / contrast adjustment for each scanned image (or manually adjusting each image), I might run a simple auto-adjusting algorithm. Also, I'd like to select a different PDF resolution, color depth and image format and quality depending on the kind of document I've scanned - in some cases I'd go for 4 bpp, greyscale, 100 dpi, Flate, in other cases I'd use 24 bpp, color, 300 dpi, JPEG with 65%~95% compression quality (and there are many more cases). AFAIK, none of these features are currently available in NAPS2.

Describe the solution you'd like Let's say there is a configuration file and/or GUI window where we could define scripts to be called before / after / instead of internal NAPS functions. For example:

Scan:
  before: [none]
  instead of: [none]
  after: normalize_image.cmd
Batch Scan:
  before: [none]
  instead of: [none]
  after: normalize_image.sh
Save PDF:
  before: [none]
  instead of: my_PDF_script.py
  after: [none]
[...]

With the above:

  • After scanning an image, NAPS2 would run normalize_image.cmd, passing the file name as a parameter to the script
  • After a batch scan, NAPS2 would run normalize_image.sh, passing the list of file names as a parameter
  • After I click "Save PDF", instead of saving a PDF, NAPS 2 would run my_PDF_script.py, passing the list of file names as a parameter

Describe alternatives you've considered I currently have to do manual tweaking (and guessing) of images inside NAPS2, then save a PDF and yet edit it on another app, or I have to save the images as JPEG or TIFF and do the processing on external apps / scripts manually.

Adding more functionality to NAPS2 (e.g., image histogram, normalization, more PDF options to control final file size and image quality) would be an interesting alternative as well, but allowing external programs / scripts to run together with NAPS2 could open many interesting and useful functionalities, too.

AltoRetrato avatar Feb 03 '23 19:02 AltoRetrato