Modify images
This action is available starting with pdfToolbox 16
The modify images action is designed to extract images from a PDF, modify them outside of pdfToolbox with a tool of your choice, and then re-insert them into the original PDF with pdfToolbox, replacing the original images. Images are re-inserted exactly where they come from, and retain their cropping, Z-order, and so on.
A possible use case would be to extract all images; use an AI-based upsampling or image improvement application, and replace the original images with the improved ones in the PDF. The functionality can be used manually using the Switchboard, or automatically using a pdfToolbox CLI command.
Switchboard

In the Switchboard, click on the "Images" group. To use this action, you have to use "Extract" and "Replace"
Extract

The "Extract" action on the Switchboard extracts all, or the selected images (using a preflight check as a filter) into a folder, together with a JSON file that identifies the images in the PDF.
Replace
You can modify any of the images that were previously extracted, but you should not modify their names. If you do modify their names, you'll need to also modify the exported JSON file so that the names of the images in the JSON and the names on disk are identical.
To replace images, make sure the original PDF is open in pdfToolbox Desktop. Then "Execute" the "Replace" action. pdfToolbox Desktop asks for the location of the JSON file. Select it, and the modified images are inserted into the PDF.
pdfToolbox CLI
In pdfToolbox CLI, the "Modify images" action is implemented as a command-line command called: "--modifyimages". It offers an additional parameter to specify whether you want to extract images or replace images:
./pdfToolbox --modifyimages --extract <pdf>
./pdfToolbox --modifyimages --extract=<kfpx> <pdf>
./pdfToolbox --modifyimages --replace <json> <pdf>
The extract command takes a PDF file and exports all images from it, together with the descriptive JSON file. Optionally, the "--extract" parameter can have the path to a pdfToolbox profile (.kfpx file). If that is the case, the profile should contain a single check that filters out those images you want to extract from the PDF.
The replace command requires both the path to the JSON file (potentially updated if necessary), and the original PDF file. The output is the modified PDF file with updated images.