Convert PDF to images in 1920x1080

The name of the pictureThe name of the pictureThe name of the pictureClash 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.



enter image description here



  • 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.



enter image description here



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 ?










share|improve this question







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.























    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.



    enter image description here



    • 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.



    enter image description here



    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 ?










    share|improve this question







    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.





















      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.



      enter image description here



      • 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.



      enter image description here



      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 ?










      share|improve this question







      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.



      enter image description here



      • 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.



      enter image description here



      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






      share|improve this question







      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.











      share|improve this question







      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.









      share|improve this question




      share|improve this question






      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.




















          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 -flatten option 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 -flatten once you're sure of the quality.


          • use something like -density 300 to get a high DPI result. The main issue with convert is 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:



          ImageMagick



          Inkscape:



          Inkscape



          GhostScript:



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


          GhostScript






          share|improve this answer





























            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






            share|improve this answer
















            • 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










            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Alrick is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            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






























            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 -flatten option 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 -flatten once you're sure of the quality.


            • use something like -density 300 to get a high DPI result. The main issue with convert is 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:



            ImageMagick



            Inkscape:



            Inkscape



            GhostScript:



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


            GhostScript






            share|improve this answer


























              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 -flatten option 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 -flatten once you're sure of the quality.


              • use something like -density 300 to get a high DPI result. The main issue with convert is 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:



              ImageMagick



              Inkscape:



              Inkscape



              GhostScript:



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


              GhostScript






              share|improve this answer
























                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 -flatten option 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 -flatten once you're sure of the quality.


                • use something like -density 300 to get a high DPI result. The main issue with convert is 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:



                ImageMagick



                Inkscape:



                Inkscape



                GhostScript:



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


                GhostScript






                share|improve this answer














                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 -flatten option 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 -flatten once you're sure of the quality.


                • use something like -density 300 to get a high DPI result. The main issue with convert is 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:



                ImageMagick



                Inkscape:



                Inkscape



                GhostScript:



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


                GhostScript







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 hours ago

























                answered 2 hours ago









                frostschutz

                25.4k15280




                25.4k15280






















                    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






                    share|improve this answer
















                    • 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














                    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






                    share|improve this answer
















                    • 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












                    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






                    share|improve this answer












                    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







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    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












                    • 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










                    Alrick is a new contributor. Be nice, and check out our Code of Conduct.









                     

                    draft saved


                    draft discarded


















                    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.













                     


                    draft saved


                    draft discarded














                    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













































































                    Comments

                    Popular posts from this blog

                    White Anglo-Saxon Protestant

                    BuddyTV

                    Conflict (narrative)