How to modify multiple images in terminal?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







6















I need to invert multiple .png images from black to white using command line.



I have found that I might use gimp plugin "plug-in-vinvert" but I can not figure out how to use it. I have tried something like



gimp -b '(plug-in-vinvert "INT32" "filename.png" "/resultsFolder/")'


and many other combinations but with no success.










share|improve this question































    6















    I need to invert multiple .png images from black to white using command line.



    I have found that I might use gimp plugin "plug-in-vinvert" but I can not figure out how to use it. I have tried something like



    gimp -b '(plug-in-vinvert "INT32" "filename.png" "/resultsFolder/")'


    and many other combinations but with no success.










    share|improve this question



























      6












      6








      6


      3






      I need to invert multiple .png images from black to white using command line.



      I have found that I might use gimp plugin "plug-in-vinvert" but I can not figure out how to use it. I have tried something like



      gimp -b '(plug-in-vinvert "INT32" "filename.png" "/resultsFolder/")'


      and many other combinations but with no success.










      share|improve this question
















      I need to invert multiple .png images from black to white using command line.



      I have found that I might use gimp plugin "plug-in-vinvert" but I can not figure out how to use it. I have tried something like



      gimp -b '(plug-in-vinvert "INT32" "filename.png" "/resultsFolder/")'


      and many other combinations but with no success.







      command-line gimp convert png






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 mins ago







      Juraj.Lorinc

















      asked Oct 26 '14 at 14:39









      Juraj.LorincJuraj.Lorinc

      4683717




      4683717






















          3 Answers
          3






          active

          oldest

          votes


















          16














          Why gimp? Try imagemagick package. It's a great command line image processor.
          In your case you can use it like:



          convert -negate src.png dst.png




          share


























          • It works, except it converts only one file.

            – Juraj.Lorinc
            Oct 26 '14 at 16:53






          • 1





            Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

            – OhmSpectator
            Oct 26 '14 at 17:06













          • I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

            – Juraj.Lorinc
            Oct 27 '14 at 9:16











          • Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

            – OhmSpectator
            Oct 27 '14 at 11:45






          • 1





            I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

            – Juraj.Lorinc
            Oct 28 '14 at 22:38





















          2














          To convert a batch of images, the fastest and shortest way I know is to use the following ImageMagick command:



          mogrify -negate *.jpg


          N.B. Change image format accordingly and make sure you have a copy of the original images.






          share|improve this answer


























          • Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

            – bonanza
            Feb 3 at 15:19



















          1














          Try this GIMP plugin for performing a routine on multiple images simultaneously: "Batch Image Manipulation Plugin" http://registry.gimp.org/node/26259



          Download and extract the package, open a terminal inside the resulting folder, and run:



          make && make install


          Then start Gimp, go to File - Batch Image Manipulation, in order to start the plugin. There you can add the multiple images.



          enter image description here



          As the question asks for inverting colors, add the corresponding manipulation set: Add - Other GIMP procedure, search for 'invert' and you will find 'gimp-invert'



          enter image description here



          OK, and before 'Apply' you can set the output folder which by default is ~/.



          Hope that helps. Have fun GIMPing!






          share|improve this answer


























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f541887%2fhow-to-modify-multiple-images-in-terminal%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            16














            Why gimp? Try imagemagick package. It's a great command line image processor.
            In your case you can use it like:



            convert -negate src.png dst.png




            share


























            • It works, except it converts only one file.

              – Juraj.Lorinc
              Oct 26 '14 at 16:53






            • 1





              Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 26 '14 at 17:06













            • I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

              – Juraj.Lorinc
              Oct 27 '14 at 9:16











            • Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 27 '14 at 11:45






            • 1





              I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

              – Juraj.Lorinc
              Oct 28 '14 at 22:38


















            16














            Why gimp? Try imagemagick package. It's a great command line image processor.
            In your case you can use it like:



            convert -negate src.png dst.png




            share


























            • It works, except it converts only one file.

              – Juraj.Lorinc
              Oct 26 '14 at 16:53






            • 1





              Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 26 '14 at 17:06













            • I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

              – Juraj.Lorinc
              Oct 27 '14 at 9:16











            • Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 27 '14 at 11:45






            • 1





              I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

              – Juraj.Lorinc
              Oct 28 '14 at 22:38
















            16












            16








            16







            Why gimp? Try imagemagick package. It's a great command line image processor.
            In your case you can use it like:



            convert -negate src.png dst.png




            share















            Why gimp? Try imagemagick package. It's a great command line image processor.
            In your case you can use it like:



            convert -negate src.png dst.png





            share













            share


            share








            edited Oct 26 '14 at 15:43









            muru

            1




            1










            answered Oct 26 '14 at 15:04









            OhmSpectatorOhmSpectator

            35636




            35636













            • It works, except it converts only one file.

              – Juraj.Lorinc
              Oct 26 '14 at 16:53






            • 1





              Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 26 '14 at 17:06













            • I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

              – Juraj.Lorinc
              Oct 27 '14 at 9:16











            • Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 27 '14 at 11:45






            • 1





              I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

              – Juraj.Lorinc
              Oct 28 '14 at 22:38





















            • It works, except it converts only one file.

              – Juraj.Lorinc
              Oct 26 '14 at 16:53






            • 1





              Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 26 '14 at 17:06













            • I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

              – Juraj.Lorinc
              Oct 27 '14 at 9:16











            • Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

              – OhmSpectator
              Oct 27 '14 at 11:45






            • 1





              I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

              – Juraj.Lorinc
              Oct 28 '14 at 22:38



















            It works, except it converts only one file.

            – Juraj.Lorinc
            Oct 26 '14 at 16:53





            It works, except it converts only one file.

            – Juraj.Lorinc
            Oct 26 '14 at 16:53




            1




            1





            Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

            – OhmSpectator
            Oct 26 '14 at 17:06







            Add loop: for i in `ls *.jpg`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

            – OhmSpectator
            Oct 26 '14 at 17:06















            I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

            – Juraj.Lorinc
            Oct 27 '14 at 9:16





            I have tried your code, but it is not working for me. I guess I am doing some stupid mistake, because I am quite new with Linux. I paste your code directly into terminal and when i press enter, all I get is ">".

            – Juraj.Lorinc
            Oct 27 '14 at 9:16













            Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

            – OhmSpectator
            Oct 27 '14 at 11:45





            Are you sure you have copied the whole string? From for to done? BTW, there is a mistake in the string: not *.jpg, but *.png. So the right one: for i in `ls *.png`; do convert ${i%.*}.png ${i%.*}-inverted.png; done

            – OhmSpectator
            Oct 27 '14 at 11:45




            1




            1





            I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

            – Juraj.Lorinc
            Oct 28 '14 at 22:38







            I was not working because I have copied it without the "done". You have there one small error, but the working code is for i in `ls *.png`; do convert -negate ${i%.*}.png results/${i%.*}.png; done I have just added -negate and changed the code to place the inverted images into "results" folder.

            – Juraj.Lorinc
            Oct 28 '14 at 22:38















            2














            To convert a batch of images, the fastest and shortest way I know is to use the following ImageMagick command:



            mogrify -negate *.jpg


            N.B. Change image format accordingly and make sure you have a copy of the original images.






            share|improve this answer


























            • Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

              – bonanza
              Feb 3 at 15:19
















            2














            To convert a batch of images, the fastest and shortest way I know is to use the following ImageMagick command:



            mogrify -negate *.jpg


            N.B. Change image format accordingly and make sure you have a copy of the original images.






            share|improve this answer


























            • Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

              – bonanza
              Feb 3 at 15:19














            2












            2








            2







            To convert a batch of images, the fastest and shortest way I know is to use the following ImageMagick command:



            mogrify -negate *.jpg


            N.B. Change image format accordingly and make sure you have a copy of the original images.






            share|improve this answer















            To convert a batch of images, the fastest and shortest way I know is to use the following ImageMagick command:



            mogrify -negate *.jpg


            N.B. Change image format accordingly and make sure you have a copy of the original images.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 4 at 14:18

























            answered Jan 3 at 7:37









            maxagazmaxagaz

            715




            715













            • Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

              – bonanza
              Feb 3 at 15:19



















            • Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

              – bonanza
              Feb 3 at 15:19

















            Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

            – bonanza
            Feb 3 at 15:19





            Thanks, perfect! For me, it was magick mogrify -negate *.png as mogrify does not seem to be a directly callable (archlinux)

            – bonanza
            Feb 3 at 15:19











            1














            Try this GIMP plugin for performing a routine on multiple images simultaneously: "Batch Image Manipulation Plugin" http://registry.gimp.org/node/26259



            Download and extract the package, open a terminal inside the resulting folder, and run:



            make && make install


            Then start Gimp, go to File - Batch Image Manipulation, in order to start the plugin. There you can add the multiple images.



            enter image description here



            As the question asks for inverting colors, add the corresponding manipulation set: Add - Other GIMP procedure, search for 'invert' and you will find 'gimp-invert'



            enter image description here



            OK, and before 'Apply' you can set the output folder which by default is ~/.



            Hope that helps. Have fun GIMPing!






            share|improve this answer






























              1














              Try this GIMP plugin for performing a routine on multiple images simultaneously: "Batch Image Manipulation Plugin" http://registry.gimp.org/node/26259



              Download and extract the package, open a terminal inside the resulting folder, and run:



              make && make install


              Then start Gimp, go to File - Batch Image Manipulation, in order to start the plugin. There you can add the multiple images.



              enter image description here



              As the question asks for inverting colors, add the corresponding manipulation set: Add - Other GIMP procedure, search for 'invert' and you will find 'gimp-invert'



              enter image description here



              OK, and before 'Apply' you can set the output folder which by default is ~/.



              Hope that helps. Have fun GIMPing!






              share|improve this answer




























                1












                1








                1







                Try this GIMP plugin for performing a routine on multiple images simultaneously: "Batch Image Manipulation Plugin" http://registry.gimp.org/node/26259



                Download and extract the package, open a terminal inside the resulting folder, and run:



                make && make install


                Then start Gimp, go to File - Batch Image Manipulation, in order to start the plugin. There you can add the multiple images.



                enter image description here



                As the question asks for inverting colors, add the corresponding manipulation set: Add - Other GIMP procedure, search for 'invert' and you will find 'gimp-invert'



                enter image description here



                OK, and before 'Apply' you can set the output folder which by default is ~/.



                Hope that helps. Have fun GIMPing!






                share|improve this answer















                Try this GIMP plugin for performing a routine on multiple images simultaneously: "Batch Image Manipulation Plugin" http://registry.gimp.org/node/26259



                Download and extract the package, open a terminal inside the resulting folder, and run:



                make && make install


                Then start Gimp, go to File - Batch Image Manipulation, in order to start the plugin. There you can add the multiple images.



                enter image description here



                As the question asks for inverting colors, add the corresponding manipulation set: Add - Other GIMP procedure, search for 'invert' and you will find 'gimp-invert'



                enter image description here



                OK, and before 'Apply' you can set the output folder which by default is ~/.



                Hope that helps. Have fun GIMPing!







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 23 '16 at 18:10







                user47206

















                answered Oct 26 '14 at 17:51









                Ronald ChuaRonald Chua

                865




                865






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f541887%2fhow-to-modify-multiple-images-in-terminal%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

                    GameSpot

                    connect to host localhost port 22: Connection refused

                    Getting a Wifi WPA2 wifi connection