How can I batch-process images to adjust contrast in terminal?





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







2















I've scanned 200+ pages. I am wondering if it is possible to touch these up by running a batch command line image software with a contrast manipulation option. Essentially I am wanting to give a command such as:



image_software *.JPG --contrast -1


The pages I scanned have content on both sides. The smallest amount of the content from the reverse side is showing in the scanned image. It is like a watermark --- online annoying.



What software + command might work for what I am describing?










share|improve this question

























  • I suspect you might be after the -brightness-contrast of imagemagick combined with a for loop. Some details here: imagemagick.org/script/… Let me know if this is something like what you are after?

    – andrew.46
    May 17 '18 at 7:06













  • @andrew.46 Yes this is what I am wanting to do. Perhaps a reduction by 10

    – Ron Piggott
    May 19 '18 at 4:01


















2















I've scanned 200+ pages. I am wondering if it is possible to touch these up by running a batch command line image software with a contrast manipulation option. Essentially I am wanting to give a command such as:



image_software *.JPG --contrast -1


The pages I scanned have content on both sides. The smallest amount of the content from the reverse side is showing in the scanned image. It is like a watermark --- online annoying.



What software + command might work for what I am describing?










share|improve this question

























  • I suspect you might be after the -brightness-contrast of imagemagick combined with a for loop. Some details here: imagemagick.org/script/… Let me know if this is something like what you are after?

    – andrew.46
    May 17 '18 at 7:06













  • @andrew.46 Yes this is what I am wanting to do. Perhaps a reduction by 10

    – Ron Piggott
    May 19 '18 at 4:01














2












2








2








I've scanned 200+ pages. I am wondering if it is possible to touch these up by running a batch command line image software with a contrast manipulation option. Essentially I am wanting to give a command such as:



image_software *.JPG --contrast -1


The pages I scanned have content on both sides. The smallest amount of the content from the reverse side is showing in the scanned image. It is like a watermark --- online annoying.



What software + command might work for what I am describing?










share|improve this question
















I've scanned 200+ pages. I am wondering if it is possible to touch these up by running a batch command line image software with a contrast manipulation option. Essentially I am wanting to give a command such as:



image_software *.JPG --contrast -1


The pages I scanned have content on both sides. The smallest amount of the content from the reverse side is showing in the scanned image. It is like a watermark --- online annoying.



What software + command might work for what I am describing?







command-line image-processing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 21 mins ago









Zanna

51.6k13141244




51.6k13141244










asked May 17 '18 at 3:16









Ron PiggottRon Piggott

2661618




2661618













  • I suspect you might be after the -brightness-contrast of imagemagick combined with a for loop. Some details here: imagemagick.org/script/… Let me know if this is something like what you are after?

    – andrew.46
    May 17 '18 at 7:06













  • @andrew.46 Yes this is what I am wanting to do. Perhaps a reduction by 10

    – Ron Piggott
    May 19 '18 at 4:01



















  • I suspect you might be after the -brightness-contrast of imagemagick combined with a for loop. Some details here: imagemagick.org/script/… Let me know if this is something like what you are after?

    – andrew.46
    May 17 '18 at 7:06













  • @andrew.46 Yes this is what I am wanting to do. Perhaps a reduction by 10

    – Ron Piggott
    May 19 '18 at 4:01

















I suspect you might be after the -brightness-contrast of imagemagick combined with a for loop. Some details here: imagemagick.org/script/… Let me know if this is something like what you are after?

– andrew.46
May 17 '18 at 7:06







I suspect you might be after the -brightness-contrast of imagemagick combined with a for loop. Some details here: imagemagick.org/script/… Let me know if this is something like what you are after?

– andrew.46
May 17 '18 at 7:06















@andrew.46 Yes this is what I am wanting to do. Perhaps a reduction by 10

– Ron Piggott
May 19 '18 at 4:01





@andrew.46 Yes this is what I am wanting to do. Perhaps a reduction by 10

– Ron Piggott
May 19 '18 at 4:01










1 Answer
1






active

oldest

votes


















5














One excellent option is to use ImageMagick's -brightness-contrast option in combination with a bash for loop.



To see how it all works first find a test image and experiment with the following syntax:



convert -brightness-contrast 10x5 input.jpg output.jpg


The -brightness-contrast option has 2 elements:





  1. -brightness. In the example above this has been set at 10 and possible settings are from -100 to +100. Positive values increase the brightness while negative values decrease the brightness. Using a '0' value means that the brightness will remain unchanged.


  2. -contrast. In the example above this has been set at 5 and again possible settings are from -100 to +100. Positive values increase the contrast while negative values decrease the contrast. Using a '0' value means that the contrast will remain unchanged.


Once you have found the settings best for your image you can navigate to the folder holding your images and run a for loop:



for j in *.jpg
do
convert -brightness-contrast 10x5 "$j" altered_"$j"
done


Here you can see I have made a small naming alteration for the output file which you can of course tailor to your specific needs.



There are many different ways to accomplish your goal with ImageMagick but this would be my own choice as it is the easiest to use and to understand :).



References:





  • ImageMagick -brightness-contrast: All of the details on this command from the ImageMagick web site.






share|improve this answer
























  • Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

    – Ron Piggott
    May 21 '18 at 20:47











  • @RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

    – andrew.46
    May 21 '18 at 21:21












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%2f1037210%2fhow-can-i-batch-process-images-to-adjust-contrast-in-terminal%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














One excellent option is to use ImageMagick's -brightness-contrast option in combination with a bash for loop.



To see how it all works first find a test image and experiment with the following syntax:



convert -brightness-contrast 10x5 input.jpg output.jpg


The -brightness-contrast option has 2 elements:





  1. -brightness. In the example above this has been set at 10 and possible settings are from -100 to +100. Positive values increase the brightness while negative values decrease the brightness. Using a '0' value means that the brightness will remain unchanged.


  2. -contrast. In the example above this has been set at 5 and again possible settings are from -100 to +100. Positive values increase the contrast while negative values decrease the contrast. Using a '0' value means that the contrast will remain unchanged.


Once you have found the settings best for your image you can navigate to the folder holding your images and run a for loop:



for j in *.jpg
do
convert -brightness-contrast 10x5 "$j" altered_"$j"
done


Here you can see I have made a small naming alteration for the output file which you can of course tailor to your specific needs.



There are many different ways to accomplish your goal with ImageMagick but this would be my own choice as it is the easiest to use and to understand :).



References:





  • ImageMagick -brightness-contrast: All of the details on this command from the ImageMagick web site.






share|improve this answer
























  • Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

    – Ron Piggott
    May 21 '18 at 20:47











  • @RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

    – andrew.46
    May 21 '18 at 21:21
















5














One excellent option is to use ImageMagick's -brightness-contrast option in combination with a bash for loop.



To see how it all works first find a test image and experiment with the following syntax:



convert -brightness-contrast 10x5 input.jpg output.jpg


The -brightness-contrast option has 2 elements:





  1. -brightness. In the example above this has been set at 10 and possible settings are from -100 to +100. Positive values increase the brightness while negative values decrease the brightness. Using a '0' value means that the brightness will remain unchanged.


  2. -contrast. In the example above this has been set at 5 and again possible settings are from -100 to +100. Positive values increase the contrast while negative values decrease the contrast. Using a '0' value means that the contrast will remain unchanged.


Once you have found the settings best for your image you can navigate to the folder holding your images and run a for loop:



for j in *.jpg
do
convert -brightness-contrast 10x5 "$j" altered_"$j"
done


Here you can see I have made a small naming alteration for the output file which you can of course tailor to your specific needs.



There are many different ways to accomplish your goal with ImageMagick but this would be my own choice as it is the easiest to use and to understand :).



References:





  • ImageMagick -brightness-contrast: All of the details on this command from the ImageMagick web site.






share|improve this answer
























  • Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

    – Ron Piggott
    May 21 '18 at 20:47











  • @RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

    – andrew.46
    May 21 '18 at 21:21














5












5








5







One excellent option is to use ImageMagick's -brightness-contrast option in combination with a bash for loop.



To see how it all works first find a test image and experiment with the following syntax:



convert -brightness-contrast 10x5 input.jpg output.jpg


The -brightness-contrast option has 2 elements:





  1. -brightness. In the example above this has been set at 10 and possible settings are from -100 to +100. Positive values increase the brightness while negative values decrease the brightness. Using a '0' value means that the brightness will remain unchanged.


  2. -contrast. In the example above this has been set at 5 and again possible settings are from -100 to +100. Positive values increase the contrast while negative values decrease the contrast. Using a '0' value means that the contrast will remain unchanged.


Once you have found the settings best for your image you can navigate to the folder holding your images and run a for loop:



for j in *.jpg
do
convert -brightness-contrast 10x5 "$j" altered_"$j"
done


Here you can see I have made a small naming alteration for the output file which you can of course tailor to your specific needs.



There are many different ways to accomplish your goal with ImageMagick but this would be my own choice as it is the easiest to use and to understand :).



References:





  • ImageMagick -brightness-contrast: All of the details on this command from the ImageMagick web site.






share|improve this answer













One excellent option is to use ImageMagick's -brightness-contrast option in combination with a bash for loop.



To see how it all works first find a test image and experiment with the following syntax:



convert -brightness-contrast 10x5 input.jpg output.jpg


The -brightness-contrast option has 2 elements:





  1. -brightness. In the example above this has been set at 10 and possible settings are from -100 to +100. Positive values increase the brightness while negative values decrease the brightness. Using a '0' value means that the brightness will remain unchanged.


  2. -contrast. In the example above this has been set at 5 and again possible settings are from -100 to +100. Positive values increase the contrast while negative values decrease the contrast. Using a '0' value means that the contrast will remain unchanged.


Once you have found the settings best for your image you can navigate to the folder holding your images and run a for loop:



for j in *.jpg
do
convert -brightness-contrast 10x5 "$j" altered_"$j"
done


Here you can see I have made a small naming alteration for the output file which you can of course tailor to your specific needs.



There are many different ways to accomplish your goal with ImageMagick but this would be my own choice as it is the easiest to use and to understand :).



References:





  • ImageMagick -brightness-contrast: All of the details on this command from the ImageMagick web site.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 19 '18 at 4:46









andrew.46andrew.46

22.5k1471150




22.5k1471150













  • Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

    – Ron Piggott
    May 21 '18 at 20:47











  • @RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

    – andrew.46
    May 21 '18 at 21:21



















  • Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

    – Ron Piggott
    May 21 '18 at 20:47











  • @RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

    – andrew.46
    May 21 '18 at 21:21

















Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

– Ron Piggott
May 21 '18 at 20:47





Is there a command which would allow me to rotate images by degrees? Such as 5 degrees left or 3 degrees right?

– Ron Piggott
May 21 '18 at 20:47













@RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

– andrew.46
May 21 '18 at 21:21





@RonPiggott Indeed there is :). Trying experimenting with convert -rotate xxx command. I have not ever used this but I beieve the integer (where I have placed 'xxx') can be either negative or positive. This could possibly be a new question rather than a continuation of this question? Check for duplicates first though!

– andrew.46
May 21 '18 at 21:21


















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%2f1037210%2fhow-can-i-batch-process-images-to-adjust-contrast-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