>
sudo apt-get install imagemagick
ImageMagick
(Use image instead of the specific file name.)
With the convert image. PDF image. JPG code> can translate directly, but the image resolution is not high
with the following command transformation effect is better
convert -verbose -colorspace RGB -resize 1800 -interlace none -density 300 -quality 100 image.pdf image.jpg
(-Resize the following coefficient to adjust the width of the image in pixels, and the height to scale)
If the following error occurs
convert: not authorized `grade.pdf' @ error/constitute.c/ReadImage/412.
convert: no images defined `*.jpg' @ error/convert.c/ConvertImageCommand/3210.
Because the ImageMagick policy. XML file does not give "read and write PDF files" permission by default.
Open the policy-.xml file
sudo vi /etc/ImageMagick-6/policy.xml
< policy domain="coder" rights="none" pattern="PDF" /> code>
in the "none" code>
instead "read/write" code>
In addition, a few simple features of ImageMagick are also posted below
Pictures are made into GIFs
convert *.jpg images.gif
Where * is the wildcard, *. JPG means all the path under the JPG file
in addition to the image format in JPG, can also be PNG and other common image format
Modify image size
Take a single picture for example
convert 'image.jpg' -resize 1200 image2.jpg
(1200 means that the width becomes 1200 pixels, and the height varies proportionally)
Take several pictures for example
convert '*.jpg' -resize 1200 %03d.jpg
(can also be converted to other image format)
(% 3 d. The JPG said to give the picture of the new generation in 000. The JPG, 001 JPG rule named)
(if written image % 3 d. The JPG, said to a new generation of picture by image000. The JPG, image001. The law of the JPG)
This can also be written:
convert '*.jpg[1200]' %03d.jpg
Read More:
- FileNotFoundError: [Errno 2] No such file or directory: ‘./mnist_image_label/mnist_train_jpg_6000028
- Error converting jupyter notebook to PDF
- The solution of PDF file unable to display thumbnail in win7
- Error in compiling rmarkdown to PDF file` xxx.sty ‘ not found.
- Ueditor paste word image and upload image file automatically
- [docker] error in deleting image: image is referenced in multiple repositories
- Solution of error converting data type varchar to datetime in SQL Server
- error: Some data has already been output, can’t send PDF file
- Failed to load image from file “* * *. Png“
- Can’t create PDF file with font Calibri bold error resolution
- Ubuntu network configuration+Fixing “Failed to bring up eth0” in Ubuntu
- How to generate PDF by C #
- Ant Design upload listtype = “picture card” realizes multi image upload and click preview image encapsulation
- VTK cultivation 26: basic operation of image_ Three dimensional image slice extraction
- Solve the problem of “bash. / don’t have that file or directory” in Ubuntu 64 bit
- Error in header file when calling OpenGL to open obj file in vs2013: unable to open include file: “GL / glut. H”: no such file or directories
- JavaScript to achieve image rotation effect
- Converting string object into datetime type in pandas
- Image file upload error org.springframework.beans .ConversionNotSupportedException
- Error converting data type nvarchar to datetime