InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mac Command Line tutorials

  • Bulk convert jpeg files to png using sips on mac
  • Custom terminal tab title and ssh on mac
  • How to convert text to speech on Mac using command line utility say
  • How to join multiple pdf files on Mac
  • How to use qpdf to add/remove password from pdf on mac
  • Install redis on Mac
  • Mac - find which process is listening on a port
  • Mac - hide and unhide a file or directory
  • Mac - open a terminal from a folder
  • Mac - print java home on command line
  • Mac - search files on command line using mdfind
  • Mac command line convert svg to png
  • Mac command line utility open - some handy tips for better productivity
  • Mac terminal - how to close shell on exit
  • mac pkgutil - quick start guide
 
  • Home
  • > Tutorials
  • > Mac
  • > Mac Command Line

Mac command line convert svg to png

on Oct 29, 2022

convert utility on Mac (it comes with imagemagick package) can be used to convert an svg to png. Here is an example.

SVG file (test.svg)

<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720">
<rect width="1280" height="720" style="fill:green;" />
<text x="120" y="160" style="font-size:100px;fill:white;">Hello</text>
</svg>

Run the following command to create test.png from above svg

convert test.svg test.png

We can also use -resize in case we want to reduce size of original image. Here is the command to reduce original image by 50% (keeping aspect ratio same):

convert -resize 50% test.svg test.png

Here is the outcome from above command:

Suggested posts:

  1. How to edit animated gif speed (FPS) using imagemagick convert
  2. HTML5 – video tag
  3. How to upload closed captions for your youtube video
  4. Get image width and ppi using imagemagick identify on command line
  5. WordPress mysql query to get all custom keys and values for a post
  6. How to check if a user has password on Linux
  7. Mac brew – how to relink installed binaries for a package
  8. AngularJS hello world example
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Uncategorized | Tagged Mac Command Line
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress