How to invert colors in multiple images using Gimp in terminal?












6















I need to convert multiple .png images from black (and dark grey) to white (and light grey). I have found that I eed to 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 convert multiple .png images from black (and dark grey) to white (and light grey). I have found that I eed to 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 convert multiple .png images from black (and dark grey) to white (and light grey). I have found that I eed to 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 convert multiple .png images from black (and dark grey) to white (and light grey). I have found that I eed to 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 png






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 26 '14 at 14:39









      Juraj.LorincJuraj.Lorinc

      4493716




      4493716






















          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|improve this answer


























          • 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





















          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














            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























              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-invert-colors-in-multiple-images-using-gimp-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|improve this answer


























              • 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|improve this answer


























              • 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|improve this answer















              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|improve this answer














              share|improve this answer



              share|improve this answer








              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















              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









                  cipricus

                  10.1k47172341




                  10.1k47172341










                  answered Oct 26 '14 at 17:51









                  Ronald ChuaRonald Chua

                  865




                  865























                      1














                      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




























                        1














                        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


























                          1












                          1








                          1







                          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










                          answered Jan 3 at 7:37









                          maxagazmaxagaz

                          615




                          615






























                              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-invert-colors-in-multiple-images-using-gimp-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

                              Questions related to Moebius Transform of Characteristic Function of the Primes

                              List of scandals in India

                              Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?