How to make transparent background from pdf to png

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3















I try to convert a latex pdf to png and the background should be transparent.



So I use pdftopng from XpdfReader for windows to convert: (bat-File)



pdflatex Other.tex
pdfcrop Other.pdf
pdftopng -r 300 Other-crop.pdf Other
del Other-crop.pdf


The source is:



documentclass[border=10pt,tikz]standalone
usepackagetikz

begindocument

begintikzpicture
draw [very thick,fill=green!20!white]
(-4, 4) circle (2.0cm) node textbfA;
endtikzpicture

enddocument


from the example how to remove the background for png picture



with the result:



enter image description here



Is there a way to convert the pdf to a png with a transparent background using pdftopng?










share|improve this question


























    3















    I try to convert a latex pdf to png and the background should be transparent.



    So I use pdftopng from XpdfReader for windows to convert: (bat-File)



    pdflatex Other.tex
    pdfcrop Other.pdf
    pdftopng -r 300 Other-crop.pdf Other
    del Other-crop.pdf


    The source is:



    documentclass[border=10pt,tikz]standalone
    usepackagetikz

    begindocument

    begintikzpicture
    draw [very thick,fill=green!20!white]
    (-4, 4) circle (2.0cm) node textbfA;
    endtikzpicture

    enddocument


    from the example how to remove the background for png picture



    with the result:



    enter image description here



    Is there a way to convert the pdf to a png with a transparent background using pdftopng?










    share|improve this question
























      3












      3








      3








      I try to convert a latex pdf to png and the background should be transparent.



      So I use pdftopng from XpdfReader for windows to convert: (bat-File)



      pdflatex Other.tex
      pdfcrop Other.pdf
      pdftopng -r 300 Other-crop.pdf Other
      del Other-crop.pdf


      The source is:



      documentclass[border=10pt,tikz]standalone
      usepackagetikz

      begindocument

      begintikzpicture
      draw [very thick,fill=green!20!white]
      (-4, 4) circle (2.0cm) node textbfA;
      endtikzpicture

      enddocument


      from the example how to remove the background for png picture



      with the result:



      enter image description here



      Is there a way to convert the pdf to a png with a transparent background using pdftopng?










      share|improve this question














      I try to convert a latex pdf to png and the background should be transparent.



      So I use pdftopng from XpdfReader for windows to convert: (bat-File)



      pdflatex Other.tex
      pdfcrop Other.pdf
      pdftopng -r 300 Other-crop.pdf Other
      del Other-crop.pdf


      The source is:



      documentclass[border=10pt,tikz]standalone
      usepackagetikz

      begindocument

      begintikzpicture
      draw [very thick,fill=green!20!white]
      (-4, 4) circle (2.0cm) node textbfA;
      endtikzpicture

      enddocument


      from the example how to remove the background for png picture



      with the result:



      enter image description here



      Is there a way to convert the pdf to a png with a transparent background using pdftopng?







      tikz-pgf transparency latex-2-png






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 22 at 15:03









      Mar TinMar Tin

      1558




      1558




















          2 Answers
          2






          active

          oldest

          votes


















          4














          Solution for pdftopng: (transparent background only)



          pdflatex Other.tex
          pdfcrop Other.pdf
          pdftopng -r 300 -alpha Other-crop.pdf Other
          del Other-crop.pdf


          Prepare for imagemagick:



          1. download imagemagick

          2. download ghostscript

          Solution for imagemagick:



          define a transparent color in latex:



          definecolorColorTransRGB0, 255, 0


          fill elements with it that should be transparent (background excluded)



          begindocument %DOCUMENT BEGIN
          begintikzpicture
          draw [very thick,fill=green!20!white,text=white,font=Huge] (-5, 4) circle (1.0cm) node textbfA;
          draw [very thick,fill=green!20!white,text=ColorTrans,font=Huge] (-3, 4) circle (1.0cm) node textbfA;
          endtikzpicture
          enddocument


          run bat-file and define the transparent color:



          pdflatex Other.tex
          pdfcrop Other.pdf
          magick convert -density 300 -transparent "rgb(0,255,0)" Other-crop.pdf Other.png
          del Other-crop.pdf


          result:




          enter image description here







          share|improve this answer
































            3














            With ImageMagick instead of pdftopng it's simple:



            convert -density 300 Other-crop.pdf Other.png



            enter image description here







            share|improve this answer























            • Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

              – Mar Tin
              Feb 22 at 15:24











            • @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

              – user181777
              Feb 22 at 15:35












            • thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

              – Mar Tin
              Feb 22 at 18:03










            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "85"
            ;
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476182%2fhow-to-make-transparent-background-from-pdf-to-png%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            Solution for pdftopng: (transparent background only)



            pdflatex Other.tex
            pdfcrop Other.pdf
            pdftopng -r 300 -alpha Other-crop.pdf Other
            del Other-crop.pdf


            Prepare for imagemagick:



            1. download imagemagick

            2. download ghostscript

            Solution for imagemagick:



            define a transparent color in latex:



            definecolorColorTransRGB0, 255, 0


            fill elements with it that should be transparent (background excluded)



            begindocument %DOCUMENT BEGIN
            begintikzpicture
            draw [very thick,fill=green!20!white,text=white,font=Huge] (-5, 4) circle (1.0cm) node textbfA;
            draw [very thick,fill=green!20!white,text=ColorTrans,font=Huge] (-3, 4) circle (1.0cm) node textbfA;
            endtikzpicture
            enddocument


            run bat-file and define the transparent color:



            pdflatex Other.tex
            pdfcrop Other.pdf
            magick convert -density 300 -transparent "rgb(0,255,0)" Other-crop.pdf Other.png
            del Other-crop.pdf


            result:




            enter image description here







            share|improve this answer





























              4














              Solution for pdftopng: (transparent background only)



              pdflatex Other.tex
              pdfcrop Other.pdf
              pdftopng -r 300 -alpha Other-crop.pdf Other
              del Other-crop.pdf


              Prepare for imagemagick:



              1. download imagemagick

              2. download ghostscript

              Solution for imagemagick:



              define a transparent color in latex:



              definecolorColorTransRGB0, 255, 0


              fill elements with it that should be transparent (background excluded)



              begindocument %DOCUMENT BEGIN
              begintikzpicture
              draw [very thick,fill=green!20!white,text=white,font=Huge] (-5, 4) circle (1.0cm) node textbfA;
              draw [very thick,fill=green!20!white,text=ColorTrans,font=Huge] (-3, 4) circle (1.0cm) node textbfA;
              endtikzpicture
              enddocument


              run bat-file and define the transparent color:



              pdflatex Other.tex
              pdfcrop Other.pdf
              magick convert -density 300 -transparent "rgb(0,255,0)" Other-crop.pdf Other.png
              del Other-crop.pdf


              result:




              enter image description here







              share|improve this answer



























                4












                4








                4







                Solution for pdftopng: (transparent background only)



                pdflatex Other.tex
                pdfcrop Other.pdf
                pdftopng -r 300 -alpha Other-crop.pdf Other
                del Other-crop.pdf


                Prepare for imagemagick:



                1. download imagemagick

                2. download ghostscript

                Solution for imagemagick:



                define a transparent color in latex:



                definecolorColorTransRGB0, 255, 0


                fill elements with it that should be transparent (background excluded)



                begindocument %DOCUMENT BEGIN
                begintikzpicture
                draw [very thick,fill=green!20!white,text=white,font=Huge] (-5, 4) circle (1.0cm) node textbfA;
                draw [very thick,fill=green!20!white,text=ColorTrans,font=Huge] (-3, 4) circle (1.0cm) node textbfA;
                endtikzpicture
                enddocument


                run bat-file and define the transparent color:



                pdflatex Other.tex
                pdfcrop Other.pdf
                magick convert -density 300 -transparent "rgb(0,255,0)" Other-crop.pdf Other.png
                del Other-crop.pdf


                result:




                enter image description here







                share|improve this answer















                Solution for pdftopng: (transparent background only)



                pdflatex Other.tex
                pdfcrop Other.pdf
                pdftopng -r 300 -alpha Other-crop.pdf Other
                del Other-crop.pdf


                Prepare for imagemagick:



                1. download imagemagick

                2. download ghostscript

                Solution for imagemagick:



                define a transparent color in latex:



                definecolorColorTransRGB0, 255, 0


                fill elements with it that should be transparent (background excluded)



                begindocument %DOCUMENT BEGIN
                begintikzpicture
                draw [very thick,fill=green!20!white,text=white,font=Huge] (-5, 4) circle (1.0cm) node textbfA;
                draw [very thick,fill=green!20!white,text=ColorTrans,font=Huge] (-3, 4) circle (1.0cm) node textbfA;
                endtikzpicture
                enddocument


                run bat-file and define the transparent color:



                pdflatex Other.tex
                pdfcrop Other.pdf
                magick convert -density 300 -transparent "rgb(0,255,0)" Other-crop.pdf Other.png
                del Other-crop.pdf


                result:




                enter image description here








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 22 at 18:01

























                answered Feb 22 at 15:15









                Mar TinMar Tin

                1558




                1558





















                    3














                    With ImageMagick instead of pdftopng it's simple:



                    convert -density 300 Other-crop.pdf Other.png



                    enter image description here







                    share|improve this answer























                    • Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

                      – Mar Tin
                      Feb 22 at 15:24











                    • @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

                      – user181777
                      Feb 22 at 15:35












                    • thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

                      – Mar Tin
                      Feb 22 at 18:03















                    3














                    With ImageMagick instead of pdftopng it's simple:



                    convert -density 300 Other-crop.pdf Other.png



                    enter image description here







                    share|improve this answer























                    • Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

                      – Mar Tin
                      Feb 22 at 15:24











                    • @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

                      – user181777
                      Feb 22 at 15:35












                    • thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

                      – Mar Tin
                      Feb 22 at 18:03













                    3












                    3








                    3







                    With ImageMagick instead of pdftopng it's simple:



                    convert -density 300 Other-crop.pdf Other.png



                    enter image description here







                    share|improve this answer













                    With ImageMagick instead of pdftopng it's simple:



                    convert -density 300 Other-crop.pdf Other.png



                    enter image description here








                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 22 at 15:09









                    user181777user181777

                    1085




                    1085












                    • Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

                      – Mar Tin
                      Feb 22 at 15:24











                    • @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

                      – user181777
                      Feb 22 at 15:35












                    • thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

                      – Mar Tin
                      Feb 22 at 18:03

















                    • Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

                      – Mar Tin
                      Feb 22 at 15:24











                    • @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

                      – user181777
                      Feb 22 at 15:35












                    • thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

                      – Mar Tin
                      Feb 22 at 18:03
















                    Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

                    – Mar Tin
                    Feb 22 at 15:24





                    Do you have an idea what I have to do, that for example the "A" in the circle get transparent too? Is there a way in tikz/latex to print something that interpreted as transparent in png?

                    – Mar Tin
                    Feb 22 at 15:24













                    @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

                    – user181777
                    Feb 22 at 15:35






                    @MarTin If you change the colour of A to white (or any other colour that is not the same as the line around the circle), you can use the -transparent white option

                    – user181777
                    Feb 22 at 15:35














                    thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

                    – Mar Tin
                    Feb 22 at 18:03





                    thanks you for your advice to imagemagick, I really like the project and I edit my first answer with the imagemagick solution. Have good evening.

                    – Mar Tin
                    Feb 22 at 18:03

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476182%2fhow-to-make-transparent-background-from-pdf-to-png%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay