linux convert 转化图片格式

摘要

上回用到LINKVIEW可视化染色体共线性,最后的PNG图片分辨率即使加了对应的调整参数(dpi)仍不高,软件先生成SVG再转化为PNG,所以可以自行转化为高质量的PNG。

找了一圈,linux上的ImageMagick的convert命令可以满足场景。

Use ImageMagick® to create, edit, compose, or convert digital images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, GIF, WebP, HEIC, SVG, PDF, DPX, EXR and TIFF. ImageMagick can resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

使用

density也就是dpi

# -density就是dpi
convert -density 600 chr16.svg chr16.png
# 相同地,转化格式也是这个命令格式,其他格式转化也可以
convert chr16.png chr16.jpeg
原文地址:https://www.cnblogs.com/johnsonzzz/p/15152297.html