Learning ImageMagick 1: Lomo效果

Lenaresult

resultresult

ImageMagick is a very powerful image processing command-line tool. Just a few instructions to complete complex image manipulation.

ImageMagick command less complex design so that almost any image operations can be done with one command.

Theoretically a lomo effect can use the command line to get within two, but my understanding is not deep enough for ImageMagick, with the 7 line to get.

as follows:

set layer1Color="#3066FF"
::#C0FFFF  "#000699"
set layer2Color="#000699"
set layer1Alpha=180
set layer2Alpha=180

convert %1 -fill %layer1Color% -colorize 100% layer1.png
convert layer1.png -alpha on -channel A -evaluate Set %layer1Alpha% layer1.png
convert %1 -fill %layer2Color% -colorize 100% layer2.png
convert layer2.png -alpha on -channel A -evaluate Set %layer2Alpha% layer2.png
convert %1 layer1.png -compose softlight -composite temp.png
convert temp.png layer2.png -compose exclusion -composite result.png
convert result.png -background black -vignette 0×65000  result.png

del layer1.png
del layer2.png
del temp.png

imdisplay %2

The above code into a bat file, run. Here you can also download . (Input and output file names specify your own)

Briefly explain the code, the basic lomo effect synthesis steps are divided into the following three steps: demo video

1: monochrome alpha channel masks with a layer of the input image composition soft light of

2: then a monochrome mask image with an alpha channel in step 1 was subjected to composition exclusion of

3: adding vignetting

There finer processing steps, such as glare, noise or the like. There is no consideration.

Note:

You can change color values ​​of two different masks, and alpha channel value to obtain a different effect lomo.


Reproduced in: https: //my.oschina.net/dake/blog/196673

Guess you like

Origin blog.csdn.net/weixin_34293141/article/details/91586375