User:Spitzak/sandbox

From Wikipedia, the free encyclopedia

[This is a bunch of text]

«

fooiMMM

Alpha Compositing

https://printtechnologies.org/wp-content/uploads/2020/03/pdf-reference-1.6-addendum-blend-modes.pdf

Color C = f(Aa, Bb)ab + YA(1 - b) + ZB(1 - a)

Alpha c = Xab + Ya(1 - b) + Zb(1 - a)

X is almost always equal to f(1,1), the only exceptions here are the PDF definition of Difference and Exclusion.

Y and Z are either 0 or 1, depending on whether you get transparent or the other image when one image is transparent. Some compositing libraries have options to force one or the other to 1 or 0 in all cases.

In non-premultiplied colors, the function is as follows:

Color C = f(A, B)ab + YA(a - ab) + ZB(b - ab)/ Xab + Ya(1 - b) + Zb(1 - a)

Color C = (f(A, B) - YA - ZB)ab + YAa + ZBb/ (X - Y - Z)ab + Ya + Zb

More information f, X ...
fXYZCcalternative names, notes
Porter-Duff paper
Clear000000
SrcA110AaCopy
DstB101BbNo-op, None
SrcOverA111A + B(1 - a)a + b - abOver
DstOverB111B + A(1 - b)a + b - abUnder
SrcInA100Abab
DstInB100Baab
SrcOut0010A(1 - b)a(1 - b)
DstOut0001B(1 - a)b(1 - a)Erase
SrcAtopA101Ab + B(1 - a)bIn, Above
DstAtopB110Ba + A(1 - b)aBelow
Xor0011A(1 - b) + B(1 - a)a + b - 2ab
PlusA + B211A + Ba + bAdd, Lighter
OpenGL
Saturatemix of A + B and B211A min (1, 1 - b/a) + Ba + b
PDF, SVG
ScreenA + B - AB111A + B - ABa + b - abScrn
MultiplyAB111AB + A(1 - b) + B(1 - a)a + b - abPDF spec
100ABabVector Multiply
OverlayB < ½ ? 2AB : 2(A + B - AB) - 1111A + B + (2B < b ? 2AB - Ab - Ba : Ab + Ba - 2AB - ab)a + b - abreverse HardLight
Lightenmax (A, B)111A + B - min (Ab, Ba)[a]a + b - ab
Darkenmin (A, B)111A + B - max (Ab, Ba)[a]a + b - abPDF spec
100min (Ab, Ba)[a]abcloser to min(A,B)
ColorDodgeB/1 - A111Ba2/a - A + A(1 - b) + B(1 - a)a + b - ab
ColorBurn1 - 1 - B/A111ab - b - B/Aa2 + A(1 - b) + B(1 - a)a + b - ab
HardLightA < ½ ? 2AB : 2(A + B - AB) - 1111A + B + (2A < a ? 2AB - Ab - Ba : Ab + Ba - 2AB - ab)a + b - abreverse Overlay
SoftLightB + (2A - 1)(A < ½ ? B - B2 :
B < ¼ ? 16B3 - 12B2 + 3B :
B - B)
111 B + (2A - a)(2A < a ? B - B2b :
4B < b ? 16B3b2 - 12B2b + 3B :
Bb - B) + A(1 - b)
a + b - ab
Difference|A - B|111A + B - 2 min (Ab, Ba)a + b - abPDF spec
011a + b - 2abX = f(1,1) = 0
ExclusionA + B - 2AB111A + B - 2ABa + b - abPDF spec
011a + b - 2abX = f(1,1) = 0
HueHue of A, Sat + Lum of B111(not shown)a + b - ab
SaturationSat of A, Hue + Lum of B111
ColorHue + Sat of A, Lum of B111
LuminosityLum of A, Hue + Sat of B111
Close
  1. max(A,B) and min(A,B) are not correct for premultiplied colors.

Character set

More information A, B ...
ISO-8859-1
0 1 2 3 4 5 6 7 8 9 A B C D E F
0x NUL
0000
SOH STX
1AFE
ETX EOT ENQ ACK BEL  BS   HT   LF   VT   FF   CR   SO   SI 
1x DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN  EM  SUB ESC  FS   GS   RS   US 
2x  SP  ! " # $ % & ' ( ) * + , - . /
3x 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
4x @ A
1AFE
B C D
0044
E F G H I J K L M N O
5x P Q R S T U V W X Y Z [ \ ] ^ _
6x ` a b c d e f g h i j k l m n o
7x p q r s t u v w x y z { | } ~ DEL
8x PAD HOP BPH NBH  IND NEL SSA ESA HTS HTJ VTS PLD PLU  RI   SS2 SS3
9x DCS PU1 PU2 STS CCH MW SPA EPA SOS SGC SCI  CSI   ST  OSC  PM  APC
Ax NBSP ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ SHY ® ¯
Bx ° ± ² ³ ´ µ · ¸ ¹ º » ¼ ½ ¾ ¿
Cx À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
Dx Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
Ex à á â ã ä å æ ç è é ê ë ì í î ï
Fx ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý[a] þ ÿ
  Lead byte
  Changed or added in 1963 version
  Changed in both 1963 version and 1965 draft
  Another legend
  unused
  1. y with acute
Close

examples

  • samp: M M
  • lang: M
  • var: M
  • Unichar: U+004D M LATIN CAPITAL LETTER M
  • kbd: M M
  • code: M M
  • char (current): M
  • char (box): M
  • char (serif): M
  • xt: M
  • bxt: M
  • mxt: M
  • xtd: M
  • xtn: M
  • strongbad: M

Related Articles

Wikiwand AI