Use of Java for Demonstration of Color Science Concepts Presentation of an MS Project, submitted...

Preview:

DESCRIPTION

Why Java ? Java is rich in it’s support of imaging and color. Demonstrations can (easily) be shared on the web Inherent portability to different platforms and hardware.

Citation preview

Use of Java for Demonstration Use of Java for Demonstration of Color Science Concepts of Color Science Concepts

Presentation of an MS Project, submitted to The Faculty of the Computer Science Department, in

partial fulfillment of the requirements for the degree of Master of Science in Computer

Science from Rochester Institute of Technology

John A. MooreApril 29, 1998

Project ObjectivesProject Objectives

• Gain knowledge and experience with Java Programming.

• Apply my knowledge of Color Science.• Generate a Package of general purpose

Color Science Java classes for others to use and grow.

• Complete requirements for MS Degree.

Why Java ?Why Java ?

• Java is rich in it’s support of imaging and color.

• Demonstrations can (easily) be shared on the web

• Inherent portability to different platforms and hardware.

Development EnvironmentDevelopment Environment

• Experimented with many…– Microsoft Visual J++– Semantics Visual Café for Java– Basic JDK

• Settled on JpadPro– Basic project management– Support for custom Packages– Colored coded text editor– Easy to use and learn

JpadPro JpadPro http://www.modelworks.comhttp://www.modelworks.com

Color Science FundamentalsColor Science Fundamentals

Additive Color Mixing Subtractive Color Mixing

The Java DemonstrationsThe Java Demonstrations

Three Color Science Demonstrations

Simple Subtractive Color MixingSimple Additive Color Mixing

Calculation of Helmholtz coordinates

Simple Subtractive Color Simple Subtractive Color MixingMixing

Features & Functions• Double Buffered imaging to avoid

flicker• Back-light switch to emphasize

subtraction of light.• System requirements check.• Instruction panel

Show Subtractive Show Subtractive Color Mixing AppletColor Mixing Applet

Additive Color MixingAdditive Color Mixing

Features & Functions• Allows user to choose color of each

primary• Select a color ‘mixture’ from a color

picker• Allows the user to see the selected

color in a mixer panel.• Utilizes a ‘super cell’ technique

Primary ComponentsPrimary Components

p1 p2 p3

p3 p1 p2

p2 p3 p1

p1 = primary 1p2 = primary 2p3 = primary 3

Monitor Pixel

Super pixel

Super Pixel ConceptSuper Pixel Concept

• Allows full RGB control over each “Primary”• More pleasing at 45 degree angle

Illustration of intensity variation for P1 only

P1

Where:RadialMax = ( Width / 2 ) / Tan 30RadialCenter = (Width / 2 ) / Cos 30

RadialCenter

RadialMax

30P1 P2

P3

Width

Color Picker Space Color Picker Space ImplementationImplementation

Show Additive mixing Show Additive mixing demonstrationdemonstration

coloRama

AdditiveMixerPanel

Primary

GamutPanel

PrimaryDisplay

colorPickerPanelShowMixPanel

ThreeSliderControl

gammutScreen

Class HierarchyClass Hierarchyfor Additive Color Mixingfor Additive Color Mixing

Three things to perceive colorThree things to perceive color

Source

Object

Eye

But how do you specify color….But how do you specify color….

237

224

103

Color Matching ExperimentsColor Matching Experiments

r, g, b Color Matching Functionr, g, b Color Matching Function

Wavelength ()

Transformed to x, y, zTransformed to x, y, z

• To avoid negative numbers and simplify calculations

• set y to equal the spectral luminous efficiency fnct (corresponding to a color’s lightness)

CIE 1931 Standard observer

Three things to perceive colorThree things to perceive color

ObjectSource Eye

300 400 500 600 700

300 400 500 600 700

Calculation of Tristimulus Calculation of Tristimulus ValuesValues

X = k PRxY = k PRyZ = k PRz

Where: k = 100Py

And P = relative power distribution of CIE standard illuminant R = spectral reflectance of the object

Chromaticity CoordinatesChromaticity Coordinates

• Translate the X, Y, Z to two dimensions for convenience

x = XX+Y+Z

y = YX+Y+Z

z = ZX+Y+Z

• Only need two points since: x + y + z = 1.0

Chromaticity DiagramChromaticity Diagram

The Helmholtz DemonstrationThe Helmholtz Demonstration

• Helmholtz coordinates are an alternative way to expressing chromaticity values.

But what are they…...

00

0.8

0.60.40.2

0.2

0.4

0.6

x

y

Select a White Point

Calculation of Helmholtz coordinatesCalculation of Helmholtz coordinates

Select a Sample Point

00

0.8

0.60.40.2

0.2

0.4

0.6

x

y

Calculation of Helmholtz coordinatesCalculation of Helmholtz coordinates

Next…Draw a

Line through

theWhite pointand

samplepoint

00

0.8

0.60.40.2

0.2

0.4

0.6

x

y

Calculation of Helmholtz coordinatesCalculation of Helmholtz coordinates

The “Dominant Wavelength”is determined

by the intersection

with the spectrum Locus.

00

0.8

0.60.40.2

0.2

0.4

0.6

x

y

Calculation of Helmholtz coordinatesCalculation of Helmholtz coordinates

...and the “excitation Purity” is

determined by the ratio of the

distances as shown.

00

0.8

0.60.40.2

0.2

0.4

0.6

x

y

Calculation of Helmholtz coordinatesCalculation of Helmholtz coordinates

AB

such thatPe = A/B

Complimentary WavelengthComplimentary Wavelength

The condition shown in yellow is met when...• The slope of the line is positive.• The y-value of the line at x is less than the y-value of the

locus at x.• The sample point x-chroma value is greater than the

White Point x-chroma value OR Sample point is a Complimentary Color...

The condition shown in green is met when…• The slope of the line is positive.• The y-value of the line at x is greater than the y-value of

the locus at x.• Sample point x-chroma value is less than the White Point

x-chroma value AND The sample point is not a Complimentary Color.

The condition shown in blue is met when...

• The slope of the line is negative.• The y-value of the line at x is greater than the y-value of

the locus at x.• Sample point x-chroma value is less than the White Point

x-chroma value OR The Sample point is a Complimentary Color...

The condition shown in pale red is met when...• The slope of the line is negative.• The y-value of the line at x is less than the y-value of the

locus at x.• Sample point x-chroma value is greater than the White

Point x-chroma value AND The Sample point is not a Complimentary Color...

AlgorithmAlgorithm

Show Show Helmholtz ApplicationHelmholtz Application

Helmholtz

helmholtzPanelchromaticityControls

illuminantPanel

colorSamplePanel

ChromaValuesPanel feedBackPanel

ChromaValuesPanel

feedBackPanel

chromaticityPanel

whitePointDataClass

Class HierarchyClass Hierarchyfor Additive Color Mixingfor Additive Color Mixing

Color_kit PackageColor_kit Packagecolor_kit.color_space

color_kit.color_space.uv_chromaticity color_kit.color_space.xy_10degree_chromaticity color_kit.color_space.xy_chromaticity

color_kit.dialogs color_kit.panels

color_kit.panels.bundles color_kit.panels.controls color_kit.panels.displays

color_kit.toolkit

Discussion of ResultsDiscussion of Results

• Numerous Java VM inconsistencies–Sun JDK, MS SDK, Netscape (Semantics)

• Wide performance variations• Java 1.1.5 VM roll-out

ConclusionConclusion

• Future Work• Acknowledgements

Recommended