Skip to main content
CLI: Media

CLI: Media #

dwebp #

Online manual: dwebp(1) — Arch manual pages

Credit: How to Convert WebP to PNG in Linux

$ dwebp pic.webp -o pic.png

convert (imagemagick) #

Online manual: convert(1) - Linux man page

Convert SVG #

Original size: (credit)

$ convert -background none pic.svg pic.png

Given PPI: (credit)

Reference: ImageMagick - Command-line Options #density

$ convert -density 300 pic.svg pic.png

Trim transparent part of png #

Credit: ubuntu - how to cut transparent part from photo with command or shell script - Stack Overflow

Need to read:

$ convert -fuzz 25% -trim +repage pic.png pic-trim.png

Batch trim:

$ for f in *.png;  do convert -fuzz 25% -trim +repage "$f" "${f%.png}-trim".png; done