diff --git a/xep-0385.xml b/xep-0385.xml index a8c357c0..03d3e561 100644 --- a/xep-0385.xml +++ b/xep-0385.xml @@ -31,6 +31,12 @@ TODO: sims &tobias; + + 0.2.0 + 2017-09-21 + fs +

Use 'urn:xmpp:hashes:2' and 'urn:xmpp:jingle:apps:file-transfer:5'.

+
0.1.0 2017-01-04 @@ -125,12 +131,12 @@ TODO: Look at the nice view from the summit. - + image/jpeg summit.jpg 3032449 - a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a - a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a + 2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU= + 2AfMGH8O7UNPTvUVAM9aK13mpCY= Photo from the summit. @@ -239,12 +245,12 @@ TODO: - + image/jpeg summit.jpg 3032449 - a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a - a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a + 2XarmwTlNxDAMkvymloX3S5+VbylNrJt/l5QyPa+YoU= + 2AfMGH8O7UNPTvUVAM9aK13mpCY= Photo from the summit. @@ -255,7 +261,6 @@ TODO: ]]> -

Note: that ni URIs use a Base64URL encoding for the hash value and &xep0300; uses a hexencoding.

This way the client can aquire the content addressable resource mentioned in the img-tag in the XHTML-IM message, and when finished show in in the rendered XHTML-IM message.

@@ -279,7 +284,7 @@ TODO: -

Thanks to Kim Alvefur, Emmanuel Gil Peyrot, Kevin Smith, and Nicolas Vérité for their helpful comments.

+

Thanks to Kim Alvefur, Emmanuel Gil Peyrot, Kevin Smith, Nicolas Vérité, and Florian Schmaus for their helpful comments.

REQUIRED.

diff --git a/xep-0392.xml b/xep-0392.xml index 56b25f99..6774dc3a 100644 --- a/xep-0392.xml +++ b/xep-0392.xml @@ -28,6 +28,17 @@ jonas@wielicki.name jonas@wielicki.name + + 0.2 + 2017-10-04 + jwi +

+ Move to SHA-1 as mixing function; + Properly reference BT.601 and include constants in text; + Prefer bare JID over roster name when selecting the hash function input; + Editing. +

+
0.1 2017-09-27 @@ -43,6 +54,9 @@

Colors provide a valuable visual cue to recognize text. Recognition of colors works much faster than recognition of text. Together with the length and overall shape of a piece of text (such as a nickname), a color provides a decent amount of entropy to distinguish a reasonable amount of entities.

+

Clients have been using randomly or deterministically chosen colors for users in multi-user situations for a long time already. However, since there has been no standard for how this is implemented, the experience differs across platforms. The goal of this XEP is to provide a uniform, platform-independent, stateless and easy-to-implement way to map arbitrary bytestrings to colors, as well as give recommendations how this is applied to color names of participants in conversations, roster entries and other pieces of text.

+

To allow cross-client use, it is important that the color scheme can be adapted to different environments. This specification provides means to adapt colors to different background colors as well as &cvds;.

+

In no way is the system presented in this specification a replacement for names. It only serves as an additional visual aid.

The color generation mechanism should provide the following features:

@@ -68,23 +82,23 @@

Implementations may colorize the participants of a conversation with an individual color to make them easier to distinguish.

-

In such cases, the color SHOULD be generated as described in the Generating a color section. The input used SHOULD be, in descending order of preference, (a) the name assigned in the roster, (b) the nickname from the conversation, (c) the bare JID.

+

In such cases, the color SHOULD be generated as described in the Generating a color section. The input used SHOULD be, in descending order of preference, (a) the nickname from the conversation, (b) the bare JID.

Implementations may want to show a picture in connection with a contact even if the contact does not have an avatar defined (e.g. via &xep0084;).

In such cases, auto-generating an avatar SHOULD happen as follows:

    -
  1. Obtain a name for the contact, in descending order of preference, (a) from the roster, (b) by using the nickname from the conversation, (c) by using the bare JID.
  2. +
  3. Obtain a name for the contact, in descending order of preference, (a) by using the actual bare JID of the contact (not the bare JID of the conference in case of a XEP-0045 MUC), (b) by using the nickname from the conversation.
  4. Generate a color as described in the Generating a color section.
  5. Fill an implementation-defined background shape with that color.
  6. -
  7. Render the first character of the name in white or black centered on the square.
  8. +
  9. Render the first character of the name in white or black centered on the shape.
    -
  • Implementations MUST allow the user to turn off any colorization completely.
  • -
  • Implementations MUST implement the &cvd; profiles and MUST allow the user to choose any of these profiles or to disable the correction.
  • +
  • Implementations SHOULD allow the user to turn off any colorization completely.
  • +
  • Implementations SHOULD implement the &cvd; profiles and SHOULD allow the user to choose any of these profiles or to disable the correction.
  • Implementations MUST NOT share the &cvd; correction settings with other entities.
@@ -112,7 +126,7 @@

Input: Angle in the CbCr plane, from the previous algorithm.

-

Output: Values for Cb and Cr in the YCbCr BT.601 color space in the range from -0.5 to 0.5.

+

Output: Values for Cb and Cr in the YCbCr &BT.601; color space in the range from -0.5 to 0.5.

Form a vector from the angle and project it to edges of a quad in 2D space with edge length 1 around (0, 0). The resulting coordinates are Cb and Cr:

-

Input: Values for Cb and Cr in the YCbCr BT.601 color space in the range from -0.5 to 0.5; Value for Y.

+

Input: Values for Cb and Cr in the YCbCr &BT.601; color space in the range from -0.5 to 0.5; Value for Y.

Output: Values for Red (R), Green (G) and Blue (B) in the RGB color space in the range from 0 to 1.

Note: The recommended value for Y is 0.732. See Gamma Correction for a discussion on the choice of Y.

    @@ -137,6 +151,7 @@ float g = (y - KR*r - KB*b)/KG; ]]>
  1. Clip the values of r, g and b to the range from 0 to 1.
+

See Constants for YCbCr (BT.601) for the values of KR, KG and KB.

Input: RGB values for the color to adapt (Ri, Gi, Bi) and for the background color to adapt to (Rb, Gb, Bb), in the range from 0 to 1 each.

@@ -144,25 +159,26 @@ float g = (y - KR*r - KB*b)/KG;
  1. Invert the background color by subtracting the individual channels from 1 each:
  2. +rb_inv = 1-rb; +gb_inv = 1-gb; +bb_inv = 1-bb;]]>
  3. Mix the inverted background with the color to adapt, using a mixing factor of 0.2:
  4. +rc = 0.2*rb_inv + 0.8*ri; +gc = 0.2*gb_inv + 0.8*gi; +bc = 0.2*bb_inv + 0.8*bi;]]>

Input: Values for Red (R), Green (G) and Blue (B) in the RGB color space in the range from 0 to 1.

-

Output: Values for Cb and Cr in the YCbCr BT.601 color space in the range from -0.5 to 0.5; Value for Y.

+

Output: Values for Cb and Cr in the YCbCr &BT.601; color space in the range from -0.5 to 0.5; Value for Y.

Calculate Y, Cb and Cr according to BT.601:

+

See Constants for YCbCr (BT.601) for the values of KR, KG and KB.

Input: A set of RGB colors (each component from 0 to 1).

@@ -190,53 +206,6 @@ cr = (r - y) / (1 - KR) / 2

Note: the distance metric is simply the euclidian distance in the CbCr plane.

- -

This section holds test vectors for the different configurations. The test vectors are provided as Comma Separated Values. Strings are enclosed by single quotes ('). The first line contains a header. Each row contains, in that order, the original text, the text encoded as UTF-8 as hexadecimal octets, and the Cb, Cr, Red, Green, and Blue values.

- - - - - - - - - - -

The used palette can be generated by sampling the RGB cube evenly with six samples on each axis (resulting in 216 colors). The resulting palette is commonly known as the palette of so-called "Web Safe" colors.

- - - - - - - - - -
-
@@ -245,7 +214,7 @@ text,hextext,angle,cb,cr,r,g,b -

As outlined above, implementations MUST offer the &rgblind; and &bblind; corrections as defined in the Corrections for &cvds; section. Users MUST be allowed to choose between:

+

As outlined above, implementations SHOULD offer the &rgblind; and &bblind; corrections as defined in the Corrections for &cvds; section. Users SHOULD be allowed to choose between:

  • disabling all corrections (skip the Corrections for &cvds; step entirely),
  • applying one of the &cvd; correction profiles and
  • @@ -256,12 +225,12 @@ text,hextext,angle,cb,cr,r,g,b

    This specification extracts a bit more information from an entity and shows it alongside the existing information to the user. As the algorithm is likely to produce different colors for look-alikes (see &xep0165; for examples) in JIDs, it may add additional protection against attacks based on those.

    -

    Due to the limited set of distinguishable colors, possible &cvds; and/or use of palettes, entities MUST NOT rely on colors being unique in any context.

    +

    Due to the limited set of distinguishable colors and only extracting 16 bits of the hash function output, possible &cvds; and/or use of palettes, entities MUST NOT rely on colors being unique in any context.

    This section provides an overview of design considerations made while writing this specification. It shows alternatives which have been considered, and eventually rejected.

    -

    The other common YCbCr variants, BT.709 and BT.2020, do not achieve a brightness across the color space as uniform as BT.601 does. Adapting the Y value for uniform luminosity across the range for CbCr would have complicated the algorithm with little or no gain.

    +

    The other common YCbCr variants, BT.709 and BT.2020, do not achieve a brightness across the color space as uniform as &BT.601; does. Adapting the Y value for uniform luminosity across the range for CbCr would have complicated the algorithm with little or no gain.

    The HSV and HSL color spaces fail to provide uniform luminosity with fixed value/lightness and saturation parameters. Adapting those parameters for uniform luminosity across the hue range would have complicated the algorithm with litte to no gain.

    @@ -272,17 +241,76 @@ text,hextext,angle,cb,cr,r,g,b

    In addition, more state needs to be taken into account, increasing the complexity of choosing a color.

    -

    This specification needs to collapse an arbitrarily long string into just a few bits (the angle in the CbCr plane). To do so, a CRC32 sum is used.

    -

    An alternative, which may yield better distribution of colors, would have been to use a cryptographic hash function. However, the performance and implementation cost for a cryptographic hash function is considerable compared with a simple CRC32, especially on small (less than 1 kiB) inputs.

    +

    This specification needs to collapse an arbitrarily long string into just a few bits (the angle in the CbCr plane). To do so, SHA-1 (&rfc3174;) is used.

    +

    CRC32 and Adler32 have been considered as faster alternatives. Downsides of these functions:

    +
      +
    • Bad mixing without additional entropy.
    • +
    • Adler32 is rarely available in standard libraries.
    • +
    • CRC32 is ambiguous: there are multiple polynomials in widespread use (e.g. the Ethernet and the zlib polynomials). Often it is not clear which polynomial is used by a library.
    • +
    +

    SHA-1 is widely available. From a security point of view, the exact choice of hash function does not matter here, since it is truncated to 16 bits. At this length, any cryptographic hash function is weak.

    -

    This document requires no interaction with &IANA;.

    +

    This document requires no interaction with &IANA;.

    -

    This document requires no interaction with the ®ISTRAR;.

    +

    This document requires no interaction with the ®ISTRAR;.

    Thanks to Daniel Gultsch, Georg Lukas, and Tobias Markmann.

    + + +

    Throughout the document, the constants KR, KG and KB are used. They are defined in &BT.601; as:

    + +
    + +

    This section holds test vectors for the different configurations. The test vectors are provided as Comma Separated Values. Strings are enclosed by single quotes ('). The first line contains a header. Each row contains, in that order, the original text, the text encoded as UTF-8 as hexadecimal octets, the angle in radians, and the Cb, Cr, Red, Green, and Blue values.

    + + + + + + + + + +
    + +

    The used palette can be generated by sampling the RGB cube evenly with six samples on each axis (resulting in 216 colors). The resulting palette is commonly known as the palette of so-called "Web Safe" colors.

    +

    The format of the test vectors is the same as in the full range case above.

    + + + + + + + + + +
    +
    diff --git a/xep.ent b/xep.ent index 74f3b71f..f4cc587f 100644 --- a/xep.ent +++ b/xep.ent @@ -372,6 +372,7 @@ THE SOFTWARE. ITU E.164 ITU Recommendation E.164/I.331: The International Public Telecommunication Numbering Plan (1997). This specification is not freely available; a short summary is located at <http://en.wikipedia.org/wiki/E.164>." > X.500 X.500: The Directory: Overview of concepts, models and service <http://www.itu.int/rec/T-REC-X.500-200102-I/en>." > X.841 X.841: Security techniques - Security information objects for access control <http://www.itu.int/rec/T-REC-X.841-200010-I/en>." > +BT.601 BT.601: Studio encoding parameters of digital television for standard 4:3 and wide screen 16:9 aspect ratios <https://www.itu.int/rec/R-REC-BT.601-7-201103-I/en>">