Where are the composite formula come from and why so complic

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
clhsieh
Posts: 12
Joined: 2012-10-24T00:03:11-07:00
Authentication code: 67789

Where are the composite formula come from and why so complic

Post by clhsieh »

Full title: Where are the composite formula come from and why so complicated?

I am trying to implement my own composite program but cannot get the ideal result at the edge of the object until I saw your source code.
The operation like multiply is just mention as A*B in every blending document but in your code it is:

Code: Select all

static  inline MagickRealType Multiply(const MagickRealType Sca,
  const MagickRealType Sa,const MagickRealType Dca,const MagickRealType Da)
{
  return(Sca*Dca+Sca*(1.0-Da)+Dca*(1.0-Sa));
}
Why it will be so complicated? Is there any reason that I can deduce to other operation?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Where are the composite formula come from and why so com

Post by snibgo »

They come from the SVG Compositing Specification: http://www.w3.org/TR/2009/WD-SVGCompositing-20090430/
snibgo's IM pages: im.snibgo.com
clhsieh
Posts: 12
Joined: 2012-10-24T00:03:11-07:00
Authentication code: 67789

Re: Where are the composite formula come from and why so com

Post by clhsieh »

Thanks, I will test it
Post Reply