Page 1 of 1

Adding 2 images and looping values?

Posted: 2015-07-27T18:14:52-07:00
by PandoraBox
Hello everyone,
just a quick question as I'm working on a GUI for Imageagick in python using PAGE and I'm working on some plug-in effects (The tool is going to be a total freebie) my question is can something like this be done :

pixel 1 on image 1 and pixel 1 on image 2.

200,200,200 image 1 pixel 1
127,127,127 image 2 pixel 1

To make image 3 pixel 1 the value of 200+127 = 327-255= 72

To get 72,72,72 as the pixel value in other words combining 2 images but looping the excess I can do this manually with imagej and excel but it's a pain in several places.

All the help is greatly appreciated.

PandoraBox

Re: Adding 2 images and looping values?

Posted: 2015-07-27T20:47:14-07:00
by snibgo
I don't understand the question. I think you want to add two images, taking the result modulus the Quantum.

The compose setting ModulusAdd does what you seem to want, eg:

Code: Select all

convert xc:rgb(200,200,200 xc:rgb(127,127,127) -compose ModulusAdd -composite txt:

# ImageMagick pixel enumeration: 1,1,65535,srgb
0,0: (28.2353%,28.2353%,28.2353%)  #484848484848  srgb(72,72,72)
In this example, both images have only one pixel. They can be any size you want, of course.

Re: Adding 2 images and looping values?

Posted: 2015-07-28T04:03:58-07:00
by glennrp
ModulusAdd is missing from http://imagemagick.org/script/compose.php but it does appear in the "-list compose" output.

Re: Adding 2 images and looping values?

Posted: 2015-07-28T09:04:49-07:00
by fmw42