25
votes
How to convert TXT to PDF?
LibreOffice works for this. Usage:
libreoffice --convert-to "pdf" file.txt
The output will be called file.pdf.
24
votes
Accepted
Get over 2 GB limit creating PDFs with ImageMagick
Your limitation does not stem indeed from the filesystem; or from package versions I think.
Your 2GB limit is coming from you using a 32-bit version of your OS.
The option to increase the file ...
21
votes
Creating a GIF animation from PNG files
ffmeg important GIF options + test data
To complement this answer:
wget -O opengl-rotating-triangle.zip https://github.com/cirosantilli/media/blob/master/opengl-rotating-triangle.zip?raw=true
unzip ...
20
votes
webp animation to gif animation (cli)
Running into the same issue myself, I found that using Python and its Pillow library might be the easiest way. Just import it, let it load the image file, and directly save it again with appropriate ...
15
votes
RGB color space not permitted on grayscale
I found a solution to get rid of the warning: Error in converting a PDF to a PNG in ImageMagick
convert linkedList.pdf -quality 300 -colorspace RGB output.png
With the PDF I used the resulting images ...
13
votes
How do I take a screen shot of my Xvfb buffer?
I tried something similar (on another distribution and to take a screenshot of an xterm window, but this should not be much different)
I had to use display :1 as display :0 is already used :
$ Xvfb :...
13
votes
Get over 2 GB limit creating PDFs with ImageMagick
Try limiting the pixel cache used by convert to e.g. 1 GiB:
convert 0001.miff ... 2000.miff -limit memory 1GiB -limit map 1GiB -compress jpeg -quality 80 out.pdf
Hopefully this will force ImageMagic ...
12
votes
Accepted
How can I put one photo in the top center of two other photos?
Just add a centering option:
convert \( a.png -gravity center \) \( b.png c.png +append \) -append combine.png
10
votes
How to split an image vertically using the command line?
Using the "tiles" functionality:
convert image.png -crop 1x5@ out-%d.png
https://www.imagemagick.org/Usage/crop/#crop_tile
10
votes
Shell: Output text to PNG while preserving color
A program that does that is ansilove. It is already packaged for many distributions.
For example:
$ ls --color > /tmp/output.ansi
$ ansilove -o /tmp/output.png /tmp/output.ansi
9
votes
Extract even-numbered and odd-numbered pages of a PDF into two separate PDFs
pdftk is not Open Source any longer, unfortunately. (That is a long story.)
Plain gs engine can do it, though:
gs -sDEVICE=pdfwrite \
-sPageList=odd \
-sOutputFile=odd.pdf \...
9
votes
pdf to jpg without quality loss; gscan2pdf
convert doesn't work for me. This (pdftoppm) works perfectly, however. Each of the below commands will ensure an "images" directory exists, creating it if it doesn't, and store the generated ...
9
votes
Set default pdf reader
rightclick on file
"Properties"
"Open with"
select your favourite Application
"Set as default"
Source:
https://fedoramagazine.org/how-to-select-and-set-default-...
9
votes
Accepted
ImageMagick compare without generating diff image
I was struggling with the same issue right now and found the answer: Yes!
TL; DR: You specify NULL: as the filename for the diff, i.e.
compare -metric rmse foo.png bar.png NULL:
ImageMagick's ...
8
votes
How can I convert a PNG to a PDF in high quality so it's not blurry or fuzzy?
Brian Z above provided the below, which is the correct, fully reversible, and lossless (assuming the convert step is in fact lossless, which I think it is or at least ought to be) way to put png's ...
8
votes
convert images to pdf: How to make PDF Pages same size
I highly recommend the Python CLI program img2pdf for lossless conversion:
https://gitlab.mister-muffin.de/josch/img2pdf
Example usage:
img2pdf img1.png img2.png -o out.pdf --pagesize A4
8
votes
Accepted
How to convert an image to a 24-bit BMP in commandline?
According to an ImageMagick forum post, using -type truecolor may be the correct way to force the image to 24 bit:
convert "$1" -type truecolor "$1.bmp"
8
votes
webp animation to gif animation (cli)
Your script works just fine, but you need to zero pad your individual frame names; otherwise it creates the gif with frames in a jumbled order. I fixed that and tried it on a few giphy webp animations ...
8
votes
Accepted
Convert PDF to images in 1920x1080
This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice:
use the -flatten option to ...
8
votes
Point out my mistake while converting TIFF to PNG/JPG
The YCbCr is the important point: That colorspace (it's a video colorspace, not RGB) is not converted, so either the PNG you produce has a colorspace annotation somewhere and your PNG viewer doesn't ...
7
votes
pdf to jpg without quality loss; gscan2pdf
As student's answer said pdfimages is a good option. From my experience both gs and convert export to poor quality regardless if you specify the right dpi.
But if the pdf has multiple layers per ...
7
votes
webp animation to gif animation (cli)
I would have used ffmpeg for this task. Have a look at this thread which should give you good results.
I tried with the mp4 of the gif from giphy and obtained this gif below as a result, which looks ...
7
votes
Accepted
Command line glob to view multiple images using ImageMagick's display
If you don't specify a delay, imagemagick will load the first image and wait for your input, that is
SPACE - load next image
BACKSPACE - load previous image
If you want to display the images in ...
7
votes
Accepted
How can I convert an animated gif to indivual frames and then back again to animated gif?
The first frame looks OK, except it's in 256 colors,
You're probably aware of this, but gif is a palette-based image format with only 8 bits for palette entries, i.e., at most 256 different colors. ...
6
votes
Accepted
How to pass very many options to ImageMagick?
You can pass ImageMagick options from a file, by passing it an @filename argument, in which case ImageMagick will read the arguments from the passed file.
From the documentation (see section "File ...
6
votes
Accepted
Convert an A4R (A4 lanscape) scanned jpeg, to A4R (A4 lanscape) pdf
A simple look at the documentation of the -page command line options shows that A4R doesn't exist (and I've never heard of a format with this name). If you mean A4, use -page A4 instead. If you mean ...
6
votes
Accepted
Install imagemagick with libheif on linux debian machines
The libheif and libheif-dev packages are not available for Debian Stretch. They are available for Buster but they are still in testing and not officially supported. As a result of this, installing ...
6
votes
Accepted
pipe command output to convert?
If the command that you'd like to execute is
convert 'file(0).jpg' 'file(1).jpg' ...etc... 'file(100).jpg' out.pdf
then either use your glob,
convert ./*.jpg(n) out.pdf
or to only include files in 0....
6
votes
Accepted
Confused about (obsolete?) documentation with imagmagick
Yes, you're using an old version. If you open the link you shared, https://legacy.imagemagick.org, you will see that it refers to a legacy version and suggests you upgrate to a newer one:
The main ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
imagemagick × 325image-manipulation × 70
images × 58
pdf × 43
conversion × 41
bash × 37
command-line × 27
shell-script × 21
linux × 14
debian × 12
ubuntu × 12
scripting × 11
gif × 11
shell × 10
png × 10
files × 9
find × 8
mogrify × 8
linux-mint × 7
ghostscript × 7
gimp × 7
zsh × 6
wildcards × 6
jpeg × 6
graphics × 5