vi /etc/ImageMagick-6/policy.xml
change
<policy domain="coder" rights="none" pattern="PDF" />
to:
<policy domain="coder" rights="read|write" pattern="PDF" />
https://alexvanderbist.com/2018/fixing-imagick-error-unauthorized/
convert filein.ps -trim fileout_%03d.png
(in bash)
for f in *.pdf; do
fout=${f%.pdf}.png
echo $fout
convert -density 150 ./"$f" ./"${f%.pdf}.png"
done
Convert a specific page inside one pdf:
convert -density 150 source.pdf[1] dest.png
Split pdf into pages:
pdftk A=input.pdf cat A42 A43 output pages_42_43.pdf
Use python to split pdf into pages:
#!/usr/bin/env python
import copy, sys
from pyPdf import PdfFileWriter, PdfFileReader
input = PdfFileReader(sys.stdin)
output = PdfFileWriter()
for i in [42, 43]:
output.addPage(input.getPage(i))
output.write(sys.stdout)
http://www.troubleshooters.com/linux/gimp/
Use pencil with Shift!!! (http://www.gimp.org/tutorials/Straight_Line/)
1. Open image in gimp and select what is to be cropped with the rectangle tool.
2. Note the size and position in pixels of the selected rectangle
3. In the folder with the images: mogrify -crop {width}x{height}+{x}+{y} *png
with ImageMagick (loop 0 are infinite):
convert -delay 40 -loop 0 *jpg movie.gif
or, the complicated way...
Open 1.jpg
Open as layers all other jpg's (2 to 6)
File / Dialogs / Layers (Ctrl+L) (the bottom one is the first on the movie)
File / Save as / qq.xcf
Select bottom layer (background)
Video / Split Image to Frames
gimp opens the last frame qq_00006*.xcf. Close without save
Close all
Open qq_00001.xcf
Video / VCR Navigator (reads images qq_0000*.xcf - the frames - that are there)
Click on the frames (?)
Shift + play
From the new image Untitled*.xcf : File / Frames to Image
From the new image Untitled2*.xcf : File / Save as / animation.gif
All xcf's can be removed.