Patch: Many composite/blend modes mostly compatible to Adobe Photoshop (c)

Silvio Heinrich plassy at web.de
Wed Jan 12 23:17:04 CET 2011


Phew... I think I've gone a bit mad with the blending modes :D.
I added a few. When counting everything together there should be nearly 
40 compositing modes now.
All modes should trait partly transparent layers as Photoshop is doing 
it and all modes should
respect the channel flags.
But there are two problems with this patch:

1. I used a pretty generic approach. So it relies on the compiler to do 
proper inlining. And i didn't use the optimized multiply functions. I 
had a few problems with those functions, because it seems the give no 
correct results but approximations. So I still need to check out which 
composite modes will work with the optimized functions. I just want to 
say that it could be that this is a bit/much slower then the current 
implementation (i don't know how much time you spend in optimizing this).
I personally haven't noticed any speed impact but I've got a 3GHz quad 
core, so i think i will be the last
who will notice this.

2. The "Hue" and "Saturation" modes are not working correctly but the 
"Luminosity" and "Color" modes work exactly as in Photoshop. I coded the 
algorithms after the ISO 3200-1 spec. Adobe released the texts they gave 
to the ISO committee for specification. You can find them here:
http://www.adobe.com/devnet/pdf.html
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf  
(direct link)

go to the category "Transparency" -> "Basic Composition Computations". 
This spec is of course for PDFs but it seems that Photoshop uses the 
same formulas.
Since "Luminosity" and "Color" modes are working i think i made some 
mistake in implementing the
"setSat" function (on page 327). Maybe someone else has an 
enlightenment, because I'm working in the dark right now :D.

  But apart from this two problems everything else should work fine 
(hopefully).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20110112/4eb6245f/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BlendModes.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20110112/4eb6245f/attachment-0001.bin 


More information about the kimageshop mailing list