11-27-2022, 12:21 PM
(This post was last modified: 11-27-2022, 02:10 PM by rich2005.
Edit Reason: typo
)
Sorry I can't do script-fu For linux users
ImageMagick (IM), because of backward compatibility issues, most linux is still IM6 The IM developers have a very good single file static IM7 'magick' for Linux
If you have permission issues check with IM identify -list policy you can make a ~/.config/ImageMagick/policy.xml (saves delving into root)
------------
However a non-IM non-Gimp proposition.
pdftoppm part of poppler-utils package will extract the pages @ 300 ppi
Gimp has to come into it somewhere Using Filters -> Generic -> GEGL graph you can find a good value for the Colors -> Exposure filter (or you can just use the filter as long as you understand the syntax)
You do need the GEGL package, it might not be installed. Gimp will install libgegl but not necessarily the stand-alone GEGL
For a single image
Putting those together in a bash script with img2pdf to combine the result.
Please excuse the 'hard encoded' names and paths, it is just a quick test. I am sure you will fix that. Rendered a 130 page PDF to a rather large new (all graphic) PDF in 1 min 30 seconds.
Edit: I was assuming that speed is a factor. Just got round to trying BIMP on the same 130 images, using the color curve correction, and that is only 2 mins and a couple of seconds.
ImageMagick (IM), because of backward compatibility issues, most linux is still IM6 The IM developers have a very good single file static IM7 'magick' for Linux
If you have permission issues check with IM identify -list policy you can make a ~/.config/ImageMagick/policy.xml (saves delving into root)
Code:
<policymap>
<policy domain="coder" rights="read|write" pattern="PDF" />
</policymap>
------------
However a non-IM non-Gimp proposition.
pdftoppm part of poppler-utils package will extract the pages @ 300 ppi
Code:
pdftoppm -jpeg -r 300 manual.pdf output
Gimp has to come into it somewhere Using Filters -> Generic -> GEGL graph you can find a good value for the Colors -> Exposure filter (or you can just use the filter as long as you understand the syntax)
You do need the GEGL package, it might not be installed. Gimp will install libgegl but not necessarily the stand-alone GEGL
For a single image
Code:
gegl in.jpg -o out.jpg -- exposure exposure=3.2
Putting those together in a bash script with img2pdf to combine the result.
Code:
#!/bin/bash
pdftoppm -jpeg -r 300 manual.pdf output
find . -name "*.jpg" | while read fname ; do
echo "Doing: $fname"
gegl "$fname" -o /home/rich/temp/"$fname" -- exposure exposure=3.2
done
img2pdf /home/rich/temp/*.jpg --output combined.pdf
Please excuse the 'hard encoded' names and paths, it is just a quick test. I am sure you will fix that. Rendered a 130 page PDF to a rather large new (all graphic) PDF in 1 min 30 seconds.
Edit: I was assuming that speed is a factor. Just got round to trying BIMP on the same 130 images, using the color curve correction, and that is only 2 mins and a couple of seconds.