Here is the the command to convert a in.pdf file to PNG in out folder.

magick in.pdf out\%d.png

Above command does the job, but the quality may not be good. Using -density 300 option we can increase the quality

Note: higher the -density larger the output file sizes

magick -density 300 in.pdf out\%d.png

%d.png will generate files names in 1.png, 2.png and so on

Selectively Extract or Split pages from PDF File

Most of the time you will want convert/extract only few page instead of the whole PDF file.

In below command we are telling imagemagick in.pdf[12] to only extract 13th page (page index starts from 0),

magick -density 300 in.pdf[12] out\%d.png

To convert pages 11, 13, and 19

magick -density 300 in.pdf[12,14,20] out\%d.png

To convert pages range 10-15

magick -density 300 in.pdf[9-14] out\%d.png