Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to lighten an image using ImageMagick like when using compare?

Tags:

imagemagick

As you see in the answer “Diff” an image using ImageMagick, the "delta" image is somehow lightened:

enter image description here

How would I lighten an image just like that using ImageMagick?

like image 315
Adrian Avatar asked Dec 15 '22 13:12

Adrian


2 Answers

I assume you would like to lighten 2nd image so you get 3rd but without text. So from command line this should give same results:

convert porsche.png -fill white -colorize 80%  porshe_light.png
like image 137
rostok Avatar answered Jan 31 '23 02:01

rostok


To get exactly the same type of output, just use exactly the same command as in the answer ("'Diff an image using ImageMagick") you quoted.

Just compare the image in question with itself:

convert wizard: -frame 1 wizard.png
compare wizard.png wizard.png delta.png

will give you these images, original (left) and "delta" (right):

 

Update

Incidentally, I had suspected that @rostok's answer would somehow not use the correct parameter value for his -colorize operator. But his 80% happens to be exactly correct, as can be seen by the output below:

convert wizard.png -colorize 80% wiz-light.png

(Of course I had no choice to upvote @rostok's answer too... :-)       Actually, it is even a better answer than this one, because it hints to the OP that he could change the -colorize parameter, if he wants to change the degree of the operator.)

like image 35
Kurt Pfeifle Avatar answered Jan 31 '23 01:01

Kurt Pfeifle