Colorxtractor – a Technical Aid for People with Colour Blindness
Total Page:16
File Type:pdf, Size:1020Kb
Degree Project colorXtractor – a technical aid for people with colour blindness Stefan Hochwarter 2010-08-04 Subject: Computer Science Level: Bachelor Course code: 2DV00E SE-351 95 Växjö / SE-391 82 Kalmar Tel +46-772-28 80 00 [email protected] Lnu.se Abstract The aim of this thesis is to develop an technical aid (software) to help people with colour blindness. Colour blind people have difficulties to differentiate between certain colours, so the implemented software will name a selected colour. The software is implemented as a Mozilla Firefox extension and also uses a XPCOM component. Furthermore can the user select different colour databases and change the displaying properties. Keywords: colour blindness, Mozilla Firefox extension, Colour algorithms, CIELAB, accessibility iii Contents 1. Introduction 1 1.1. Problem discussion . .1 1.2. Problem analysis . .2 1.3. Paper structure . .2 2. Background 3 2.1. Colour blindness . .3 2.1.1. Classification . .3 2.1.2. Diagnosis . .4 2.1.3. Treatment . .4 2.2. Colour blindness as a handicap . .4 2.2.1. Daily life . .4 2.2.2. Internet barriers . .5 2.3. Colour management . .7 2.3.1. Colour spaces . .7 3. Implementation 9 3.1. Features . .9 3.2. Used technologies . 10 3.2.1. XUL - XML User Interface Language . 11 3.2.2. CSS - Cascading Style Sheet . 11 3.2.3. JavaScript . 12 3.2.4. XPCOM – Cross Platform Component Object Model . 13 3.3. Colour algorithms . 15 3.3.1. RGB to CIELAB conversion . 15 3.3.2. Colour comparison algorithm . 16 3.4. Online Publication . 17 4. Conclusion 18 4.1. Analysis . 18 4.2. Final Discussion . 18 4.3. Future Work . 18 References 20 A. List of Abbreviations 22 B. List of Figures 23 C. List of Listings 24 D. Source code 25 D.1. The Mozilla Firefox extension . 25 iv D.2. The XPCOM Component . 42 v 1. Introduction This chapter of the thesis shall give a first overview of the paper and the topic, which will be discussed more detailed later on. It focuses mostly on the problem, which had to be solved. 1.1. Problem discussion The Internet is a very colourful place but for people suffering from colour blindness this fact could be a barrier. There is no treatment for this, but an aid could improve the accessibility of the Internet. Today there is no free and open-source software, which supports people suffering from colour blindness. About five percent of the population are suffering from colour blindness.[1] This means that they have problems to differentiate between certain colours and it leads to new Internet barriers when it comes to colours. Online-shopping, pie-charts or coloured status icons are just a few examples, so there is a need for an aid for those people, which can compensate the colour blindness. Figure 1.1 shows a symbolic representation. The left side illustrate the situation without any aid while at the right side an aid has been inserted and the information (e.g. a colour) can reach the user. Figure 1.1: symbolic representation of an aid [30] Actually I found the idea of this bachelor thesis originally from the “Project:Possibility Wiki” during my search for a topic: When shopping for clothes online, it’s hard for people with colourblindness to discern between different colours. Develop a browser-plugin (or a native app) that can help with this shopping scenario. This could also be useful when using Google Image Search.[16] The first decision to make was how it should be implemented. Finally I decided to implement a Mozilla Firefox extension. One reason for this decision was that Mozilla Firefox is the second most popular web browser (behind Microsoft Internet Explorer).[3] So it is the most used open source browser which offers a great documentation and com- munity for writing extensions. Another reason for solving this problem as an extension is that the user does not need to run a stand alone software. The extension is nicely integrated in the graphical user interface of Firefox. Furthermore the extension can be designed platform independent (apart from the XPCOM component). 1 1.2. Problem analysis So I decided to create a technical aid for people with colour blindness, which is imple- mented as a Mozilla Firefox extension. Before I started to write the extension, I set some goals which it should fulfil. 1. The basic feature of the extension is to name a selected colour. 2. Follow the KISS principle. KISS is a design principle and stands for “keep it simple and stupid”. The extension should be easy to use and not distract the user from his/her actual work. 3. The software should be platform independent. In other words, everywhere where Mozilla Firefox runs, the extension should work as well. 4. colorXtractor should be open source, so the source code can be reused. 5. i18n – internationalisation should be realised. 1.3. Paper structure This paper exists in two main parts. The first part will focus on the problem, namely on defective colour vision and how it affects people who are suffering from it. The second part will concentrate on the problem solving. This is mostly about the written extension, the used technologies and some interesting algorithms. 2 2. Background This chapter will provide the essential background information for writing the aid for people with colour blindness. The first part is about colour blindness in general and how it can be classified. As the extension should help people, this section will also show, why and in which way colour blindness can be a handicap. For the implementation it is also important, to know some colour spaces - each with its advantages and disadvantages. 2.1. Colour blindness Colour blindness was first scientificly documented by the English chemist, John Dalton. After he realised that he suffered from colour blindness, he published a paper on this subject in 1798: ”Extraordinary facts relating to the vision of colours”. Because of this work, colour blindness is often called Daltonism. Nowadays, Daltonism stands only for one certain type of colour blindness (deuteranopia).[1] 2.1.1. Classification Colour blindness can be classified by clinical appearance. Generally it can be differed between total colour blindness (achromatopsia) and partial colour blindness or defective colour vision. • total colour blindness (achromatopsia) • partial colour blindness – red / green colour deficit ∗ anomalous trichromacy (protanomaly and deuteranomaly) ∗ dichromatopsia (protanopia and deuteranopia) – blue / yellow colour deficit ∗ anomalous trichromacy (tritanomaly) ∗ dichromatopsia (tritanopia) Total colour blindness Persons who suffer from total colour blindness can only experience different light inten- sities but no colours. It is very rare, only 0.01 % people are affected. Possible causes are cone aplasia, cone dystrophy, retina diseases, albinism or cortex diseases.[1] Partial colour blindness This quite common disease affects mostly men (8% men, 1% woman). Beside the classifi- cation of clinical appearance you can also differentiate between inheritance and acquired colour blindness. Anomalous trichromacy is a reduced sense for red (protanomaly), green (deutera- nomaly, 50 % of the inheritance cases) or blue (tritanomaly, rare). 3 The absence of one of the three retinal cones, which are essential for colour vision, is called dichromatopsia. It leads to the typical colour confusions. This is discerned again by the three colours red, green and blue. If the missing colour is red, the disease is called protanopia. This leads to red / green colour deficit. Deuteranopia also leads to red / green colour deficit, but the missing colour is green. When blue is missing, it is called tritanopia and it leads to blue / yellow deficit. Tritanopia is very rare. When two colours are missing, it is called monochromaticity.[1] 2.1.2. Diagnosis To diagnose colour blindness, qualitative clinical tests are used. The most common tests are the Stilling colour test, the Ishihara colour test and the Farnsworth panel D15 test.[1] (a) Ishihara colour test [6] (b) Farnsworth D15 colour test [10] Figure 2.1: Colour blindness tests 2.1.3. Treatment There is no medical treatment to cure people suffering from colour blindness. However, there exists some aid for people with colour blindness. Gnome offers a library, which provides a pixel filter, according to the user’s colour blindness.[14] Another non-technical aid are contact lenses designed for people with colour blindness.[4] 2.2. Colour blindness as a handicap When it comes to daily life, colour blindness can be a big handicap. In the following section I will list some examples. 2.2.1. Daily life As my extension focuses on web accessibility, I will keep this section short. But I want to deliver insight into the world of people with colour blindness. This is best done with examples. On the first picture you can see bananas and it is clear to see which are ripe. 4 The second picture is the same, but deuteranopia is simulated. As you can see it is impossible to differentiate between ripe and unripe bananas. (a) original (b) deuteranopia Figure 2.2: Comparision of bananas [5] Another example are LED lights, used in devices to indicate something. The left picture is again the original and in the right picture protanopia was simulated. (a) original [18] (b) protanopia Figure 2.3: Comparison of LED lights 2.2.2. Internet barriers As the goal of the extension is to help people with colour blindness in the web, I want to show examples where colours can be a barrier. For people suffering from colour blindness, it can be hard or impossible to interpret a statistic when colours are the only source for matching the value to the graph. Figure 2.4 shows a pie chart, once original and once with deuteranopia simulated.