Convert PDF to images in 1920x1080

Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
i want to convert a PDF to PNG images using convert.
The images must fit the 1920x1080 ratio by having a ?x1080 ratio, and have the best quality.
Here are many options i can use with convert :
https://imagemagick.org/script/command-line-options.php#append
- First i tried the following command line :
convert my.pdf -geometry 1920x1080 -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The result of the command gives me an image with the good geometry (763x1080), but a low quality i don't want to get.

- I use convert command line without the geometry parameter as following :
convert my.pdf -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The quality of the result is exactly what i want but the resolution is not 1920x1080 ratio, but 842x595. Its does not exactly fit on height the 1920x1080 ratio.

Is it possible to get PNG images with a ?x1080 ratio and with a 100% quality from a PDF ?
Or is 842x595 the biggest ratio to get a 100% quality image ?
Should i set a DPI option to convert ?
pdf conversion imagemagick png
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
3
down vote
favorite
i want to convert a PDF to PNG images using convert.
The images must fit the 1920x1080 ratio by having a ?x1080 ratio, and have the best quality.
Here are many options i can use with convert :
https://imagemagick.org/script/command-line-options.php#append
- First i tried the following command line :
convert my.pdf -geometry 1920x1080 -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The result of the command gives me an image with the good geometry (763x1080), but a low quality i don't want to get.

- I use convert command line without the geometry parameter as following :
convert my.pdf -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The quality of the result is exactly what i want but the resolution is not 1920x1080 ratio, but 842x595. Its does not exactly fit on height the 1920x1080 ratio.

Is it possible to get PNG images with a ?x1080 ratio and with a 100% quality from a PDF ?
Or is 842x595 the biggest ratio to get a 100% quality image ?
Should i set a DPI option to convert ?
pdf conversion imagemagick png
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
i want to convert a PDF to PNG images using convert.
The images must fit the 1920x1080 ratio by having a ?x1080 ratio, and have the best quality.
Here are many options i can use with convert :
https://imagemagick.org/script/command-line-options.php#append
- First i tried the following command line :
convert my.pdf -geometry 1920x1080 -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The result of the command gives me an image with the good geometry (763x1080), but a low quality i don't want to get.

- I use convert command line without the geometry parameter as following :
convert my.pdf -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The quality of the result is exactly what i want but the resolution is not 1920x1080 ratio, but 842x595. Its does not exactly fit on height the 1920x1080 ratio.

Is it possible to get PNG images with a ?x1080 ratio and with a 100% quality from a PDF ?
Or is 842x595 the biggest ratio to get a 100% quality image ?
Should i set a DPI option to convert ?
pdf conversion imagemagick png
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
i want to convert a PDF to PNG images using convert.
The images must fit the 1920x1080 ratio by having a ?x1080 ratio, and have the best quality.
Here are many options i can use with convert :
https://imagemagick.org/script/command-line-options.php#append
- First i tried the following command line :
convert my.pdf -geometry 1920x1080 -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The result of the command gives me an image with the good geometry (763x1080), but a low quality i don't want to get.

- I use convert command line without the geometry parameter as following :
convert my.pdf -size 1920x1080 -density 1920x1080 my_resized_pdf.png
The quality of the result is exactly what i want but the resolution is not 1920x1080 ratio, but 842x595. Its does not exactly fit on height the 1920x1080 ratio.

Is it possible to get PNG images with a ?x1080 ratio and with a 100% quality from a PDF ?
Or is 842x595 the biggest ratio to get a 100% quality image ?
Should i set a DPI option to convert ?
pdf conversion imagemagick png
pdf conversion imagemagick png
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 4 hours ago
Alrick
182
182
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Alrick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice:
use the
-flattenoption to get rid of transparent background. The transparency makes it hard to judge actual quality of the result. If you need the transparency in the final image, you can remove-flattenonce you're sure of the quality.use something like
-density 300to get a high DPI result. The main issue withconvertis that it uses a very low density by default (72 DPI). This parameter has to be specified before the input file.downscaling a high DPI image might cause additional blur, so perhaps calculating the correct DPI value to achieve the desired resolution is the way to go:
$ convert -density 100 file.pdf -flatten file100.png
$ file file100.png
file100.png: PNG image data, 827 x 1169, 8-bit colormap, non-interlaced
$ echo $((1080*10000/1169))
9238
$ convert -density 92.38 file.pdf -flatten file9238.png
$ file file9238.png
file9238.png: PNG image data, 764 x 1080, 8-bit colormap, non-interlaced
I'm not sure if there is a way to have convert determine "ideal" DPI value by itself.
If you take this question to the ImageMagick IRC channel or forum, I'm sure you'd get some more advice. It helps if you provide the link to the PDF file you're working with. ;)
You can also improve quality in other ways, for example by trimming empty borders away. You're losing a lot of resolution if half of the page is white. There are even solutions that re-wrap PDF text to get the most out of available screenspace (e.g. k2pdfopt).
Finally, also try other programs. This is a matter of opinion, but I prefer using Inkscape or GhostScript directly. ImageMagick has characters "glued together", Inkscape has a more balanced result, and GhostScript allows you to render a blur-free pure pixel image (if that's something you like - use pngalpha for the blurry version, which is virtually identical to convert).
ImageMagick:

Inkscape:

GhostScript:
gs -r92.38 -sDEVICE=png48 -sOutputFile=ghostscript.png file.pdf

add a comment |Â
up vote
1
down vote
convert options are a little bit tricky.
Try:
convert -resize 1920x1080 in.pdf out.png
If your pdf has 10 pages you will get 10 files out-1.png ... out-10.png
1
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice:
use the
-flattenoption to get rid of transparent background. The transparency makes it hard to judge actual quality of the result. If you need the transparency in the final image, you can remove-flattenonce you're sure of the quality.use something like
-density 300to get a high DPI result. The main issue withconvertis that it uses a very low density by default (72 DPI). This parameter has to be specified before the input file.downscaling a high DPI image might cause additional blur, so perhaps calculating the correct DPI value to achieve the desired resolution is the way to go:
$ convert -density 100 file.pdf -flatten file100.png
$ file file100.png
file100.png: PNG image data, 827 x 1169, 8-bit colormap, non-interlaced
$ echo $((1080*10000/1169))
9238
$ convert -density 92.38 file.pdf -flatten file9238.png
$ file file9238.png
file9238.png: PNG image data, 764 x 1080, 8-bit colormap, non-interlaced
I'm not sure if there is a way to have convert determine "ideal" DPI value by itself.
If you take this question to the ImageMagick IRC channel or forum, I'm sure you'd get some more advice. It helps if you provide the link to the PDF file you're working with. ;)
You can also improve quality in other ways, for example by trimming empty borders away. You're losing a lot of resolution if half of the page is white. There are even solutions that re-wrap PDF text to get the most out of available screenspace (e.g. k2pdfopt).
Finally, also try other programs. This is a matter of opinion, but I prefer using Inkscape or GhostScript directly. ImageMagick has characters "glued together", Inkscape has a more balanced result, and GhostScript allows you to render a blur-free pure pixel image (if that's something you like - use pngalpha for the blurry version, which is virtually identical to convert).
ImageMagick:

Inkscape:

GhostScript:
gs -r92.38 -sDEVICE=png48 -sOutputFile=ghostscript.png file.pdf

add a comment |Â
up vote
2
down vote
accepted
This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice:
use the
-flattenoption to get rid of transparent background. The transparency makes it hard to judge actual quality of the result. If you need the transparency in the final image, you can remove-flattenonce you're sure of the quality.use something like
-density 300to get a high DPI result. The main issue withconvertis that it uses a very low density by default (72 DPI). This parameter has to be specified before the input file.downscaling a high DPI image might cause additional blur, so perhaps calculating the correct DPI value to achieve the desired resolution is the way to go:
$ convert -density 100 file.pdf -flatten file100.png
$ file file100.png
file100.png: PNG image data, 827 x 1169, 8-bit colormap, non-interlaced
$ echo $((1080*10000/1169))
9238
$ convert -density 92.38 file.pdf -flatten file9238.png
$ file file9238.png
file9238.png: PNG image data, 764 x 1080, 8-bit colormap, non-interlaced
I'm not sure if there is a way to have convert determine "ideal" DPI value by itself.
If you take this question to the ImageMagick IRC channel or forum, I'm sure you'd get some more advice. It helps if you provide the link to the PDF file you're working with. ;)
You can also improve quality in other ways, for example by trimming empty borders away. You're losing a lot of resolution if half of the page is white. There are even solutions that re-wrap PDF text to get the most out of available screenspace (e.g. k2pdfopt).
Finally, also try other programs. This is a matter of opinion, but I prefer using Inkscape or GhostScript directly. ImageMagick has characters "glued together", Inkscape has a more balanced result, and GhostScript allows you to render a blur-free pure pixel image (if that's something you like - use pngalpha for the blurry version, which is virtually identical to convert).
ImageMagick:

Inkscape:

GhostScript:
gs -r92.38 -sDEVICE=png48 -sOutputFile=ghostscript.png file.pdf

add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice:
use the
-flattenoption to get rid of transparent background. The transparency makes it hard to judge actual quality of the result. If you need the transparency in the final image, you can remove-flattenonce you're sure of the quality.use something like
-density 300to get a high DPI result. The main issue withconvertis that it uses a very low density by default (72 DPI). This parameter has to be specified before the input file.downscaling a high DPI image might cause additional blur, so perhaps calculating the correct DPI value to achieve the desired resolution is the way to go:
$ convert -density 100 file.pdf -flatten file100.png
$ file file100.png
file100.png: PNG image data, 827 x 1169, 8-bit colormap, non-interlaced
$ echo $((1080*10000/1169))
9238
$ convert -density 92.38 file.pdf -flatten file9238.png
$ file file9238.png
file9238.png: PNG image data, 764 x 1080, 8-bit colormap, non-interlaced
I'm not sure if there is a way to have convert determine "ideal" DPI value by itself.
If you take this question to the ImageMagick IRC channel or forum, I'm sure you'd get some more advice. It helps if you provide the link to the PDF file you're working with. ;)
You can also improve quality in other ways, for example by trimming empty borders away. You're losing a lot of resolution if half of the page is white. There are even solutions that re-wrap PDF text to get the most out of available screenspace (e.g. k2pdfopt).
Finally, also try other programs. This is a matter of opinion, but I prefer using Inkscape or GhostScript directly. ImageMagick has characters "glued together", Inkscape has a more balanced result, and GhostScript allows you to render a blur-free pure pixel image (if that's something you like - use pngalpha for the blurry version, which is virtually identical to convert).
ImageMagick:

Inkscape:

GhostScript:
gs -r92.38 -sDEVICE=png48 -sOutputFile=ghostscript.png file.pdf

This involves some trial & error and in the end, it's debatable which result you might consider to be the "best result". So allow me to just give some generic advice:
use the
-flattenoption to get rid of transparent background. The transparency makes it hard to judge actual quality of the result. If you need the transparency in the final image, you can remove-flattenonce you're sure of the quality.use something like
-density 300to get a high DPI result. The main issue withconvertis that it uses a very low density by default (72 DPI). This parameter has to be specified before the input file.downscaling a high DPI image might cause additional blur, so perhaps calculating the correct DPI value to achieve the desired resolution is the way to go:
$ convert -density 100 file.pdf -flatten file100.png
$ file file100.png
file100.png: PNG image data, 827 x 1169, 8-bit colormap, non-interlaced
$ echo $((1080*10000/1169))
9238
$ convert -density 92.38 file.pdf -flatten file9238.png
$ file file9238.png
file9238.png: PNG image data, 764 x 1080, 8-bit colormap, non-interlaced
I'm not sure if there is a way to have convert determine "ideal" DPI value by itself.
If you take this question to the ImageMagick IRC channel or forum, I'm sure you'd get some more advice. It helps if you provide the link to the PDF file you're working with. ;)
You can also improve quality in other ways, for example by trimming empty borders away. You're losing a lot of resolution if half of the page is white. There are even solutions that re-wrap PDF text to get the most out of available screenspace (e.g. k2pdfopt).
Finally, also try other programs. This is a matter of opinion, but I prefer using Inkscape or GhostScript directly. ImageMagick has characters "glued together", Inkscape has a more balanced result, and GhostScript allows you to render a blur-free pure pixel image (if that's something you like - use pngalpha for the blurry version, which is virtually identical to convert).
ImageMagick:

Inkscape:

GhostScript:
gs -r92.38 -sDEVICE=png48 -sOutputFile=ghostscript.png file.pdf

edited 2 hours ago
answered 2 hours ago
frostschutz
25.4k15280
25.4k15280
add a comment |Â
add a comment |Â
up vote
1
down vote
convert options are a little bit tricky.
Try:
convert -resize 1920x1080 in.pdf out.png
If your pdf has 10 pages you will get 10 files out-1.png ... out-10.png
1
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
add a comment |Â
up vote
1
down vote
convert options are a little bit tricky.
Try:
convert -resize 1920x1080 in.pdf out.png
If your pdf has 10 pages you will get 10 files out-1.png ... out-10.png
1
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
convert options are a little bit tricky.
Try:
convert -resize 1920x1080 in.pdf out.png
If your pdf has 10 pages you will get 10 files out-1.png ... out-10.png
convert options are a little bit tricky.
Try:
convert -resize 1920x1080 in.pdf out.png
If your pdf has 10 pages you will get 10 files out-1.png ... out-10.png
answered 4 hours ago
JJoao
6,8511826
6,8511826
1
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
add a comment |Â
1
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
1
1
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
this gives a very blurry result (low DPI upscaled)
â frostschutz
3 hours ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
@frostschutz, my bad: you are right (my tests were using raster input :-( ). Could you send me (jj@di.uminho.pt) the PDF you use in your examples, for me to do test?
â JJoao
14 mins ago
add a comment |Â
Alrick is a new contributor. Be nice, and check out our Code of Conduct.
Alrick is a new contributor. Be nice, and check out our Code of Conduct.
Alrick is a new contributor. Be nice, and check out our Code of Conduct.
Alrick is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476997%2fconvert-pdf-to-images-in-1920x1080%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
