Can a continuous RGB transformation always produce a contrasting colour?
Mathematics internal assessment — working draft
TODO:
- remove Lipschitz bound, as it’s not in the syllabus and unnecessary
1. Introduction and aim
I want to investigate a colour transformation that could be used to make a watermark distinguishable from a video’s background. My initial idea is to calculate each watermark pixel’s colour from the background pixel beneath it. The output should contrast with the input, but should also change smoothly when the input changes slightly.
TODO: Explain the actual personal experience or observation that led to this question. Add a small example of the intended watermark; do not invent an experience.
These requirements may conflict. Inverting a colour seems promising, but colours near the centre of RGB space remain close to their inverses. This leads to my research question:
Can a continuous function from the RGB cube to itself maintain a positive minimum Euclidean distance between every input colour and its output, and what does the answer imply for discrete 24-bit RGB colours?
My aim is to compare simple transformations, investigate why they fail or succeed under particular requirements, and examine whether a general mathematical obstruction exists.
TODO: State my initial prediction and reasons. Keep the exploration focused on colour transformations; implementing video processing is outside the main aim.
2. Mathematical model and requirements
2.1. Discrete colours and the continuous cube
A 24-bit RGB colour is an ordered triple , where each coordinate is an integer from 0 to 255. The set of possible colours is
These are lattice points in a cube. To investigate continuity, I also introduce the continuous model . Values between integers are permitted in this mathematical model, although they are not themselves 8-bit channel values.
TODO: Draw and label the cube, including black, white, the grayscale diagonal, and the centre . Explain why extending the domain changes the question.
| Symbol | Meaning and role |
|---|---|
| Input colour; independent variable | |
| Output colour in the continuous model; dependent variable | |
| Output colour in the discrete model, with | |
| Euclidean distance in RGB coordinate units | |
| Input–output distance | |
| Chosen minimum distance requirement; fixed within a comparison | |
| Optional bound on output change relative to input change |
The channel range, distance formula, and restriction that outputs remain in the same cube are held fixed across the comparisons.
TODO: Introduce any further parameters where used. Keep exact values in derivations and round reported non-integer distances consistently, for example to three significant figures.
2.2. A mathematical definition of contrast
I will use Euclidean distance as a geometric measure of separation:
My contrast requirement is for every . This is stronger than merely producing a different colour. Euclidean RGB distance is a modelling choice; it does not establish a universal threshold for human visibility.
TODO: Work through one distance calculation. Keep symbolic initially, then choose and justify an illustrative value for comparisons. If discussing perception, add an appropriate source and explain the limits of this distance measure.
2.3. What does “smoothly” mean?
On , continuity expresses that sufficiently small changes in input produce small changes in output. It does not by itself guarantee that output changes will be small at the scale of actual video frames. A stronger, quantitative condition would be
On the finite set , every function is continuous under the usual inherited Euclidean metric, so continuity alone cannot distinguish useful digital transformations. I can instead inspect changes between neighbouring lattice points, or use the inequality above for .
TODO: Explain the finite-set observation using the minimum spacing between distinct points. Define neighbours as points differing by 1 in exactly one channel. Decide whether to use a full Lipschitz bound or just neighbouring-point comparisons; avoid adding unnecessary theory.
2.4. Scope of the watermark model
The model assigns an output colour separately to each background pixel and assumes that this output is displayed directly. Such a watermark may contain many colours, so “adaptive watermark” describes it more accurately than “monochrome watermark”.
TODO: Confirm this intended meaning. State that transparency, display behaviour, and abrupt background changes are not modelled. Explain why continuity of the colour rule alone cannot promise flicker-free video.
3. First attempt: reflection through the centre
My first transformation reverses each channel:
This exchanges black and white. However, at the continuous cube’s centre , the output equals the input. To understand the surrounding region, I begin with
TODO: Rewrite this as . Derive the region where , remembering to intersect it with the cube. Show that reflection preserves distances between pairs of inputs and thus satisfies the change bound with .
The discrete grid does not contain . Its eight nearest points have coordinates chosen from ; reflection exchanges opposite points in this small central cube. For example, #7F7F7F maps to #808080, giving distance .
TODO: Prove this is the minimum discrete distance for reflection. Explain that absence of an exact fixed point does not guarantee a useful distance threshold. Do not label the difference invisible without evidence.
4. Second attempt: shifting with wraparound
To avoid central near-matches, I can shift each integer channel by half its range and wrap it around:
This construction starts on . The scalar rule gives but : a one-unit input change can cause a 255-unit output change.
TODO: Derive its constant input–output distance and compare it with reflection. Use two RGB inputs differing only across this boundary to quantify the jump. Plot using discrete points and label both axes.
A corresponding continuous-cube experiment must be defined separately. One possible rule on is
TODO: Compare the left-hand limit at with the function value. Explain why wraparound creates a discontinuity in the ordinary RGB cube. Reflect on which requirement this attempt sacrifices.
5. Is the conflict unavoidable in the continuous model?
5.1. A one-dimensional starting point
Before considering three dimensions, I can investigate any continuous function . Define . Since the outputs remain in the interval, and .
TODO: Use the intermediate value theorem, including the endpoint cases, to prove that somewhere. Explain why this is a fixed point. This argument motivates the three-dimensional result but does not prove it.
5.2. Applying Brouwer’s fixed point theorem
The relevant form of Brouwer’s fixed point theorem states that every continuous map from a nonempty compact convex subset of Euclidean space to itself has a fixed point. The cube satisfies these conditions. Therefore, any continuous has some such that
TODO: Add a reliable mathematical citation for the theorem. Explain compactness and convexity only as far as needed to check the hypotheses. Complete the contradiction with everywhere. Clearly identify this as an application of a cited theorem, not my own proof of Brouwer’s theorem.
This would explain why changing the formula cannot solve the stated continuous problem. It does not directly establish impossibility for arbitrary functions on .
TODO: Reflect on how this changes my initial prediction. Keep the one-dimensional proof and explicit transformations central so that the exploration demonstrates my understanding rather than relying only on an advanced theorem.
6. Returning to 24-bit RGB
Reflection already demonstrates that a discrete transformation can avoid exact fixed points. The remaining question is how a quantitative smoothness condition limits its possible minimum distance.
As a possible extension, suppose a continuous satisfies a Lipschitz bound and has fixed point . Choose a nearest lattice point . Each coordinate differs by at most , so . The triangle inequality gives a starting point:
TODO (optional extension): Obtain a bound in terms of . If defining a digital rule by rounding , include the extra rounding error. State all assumptions: this argument concerns samples of a continuous Lipschitz map and does not automatically cover every digital rule. Retain this section only if I can explain it clearly and it supports the aim.
7. Evaluation and possible changes to the requirements
The attempted transformations suggest a tradeoff between geometric separation and controlled output changes. I will compare them using the same definitions instead of judging them only by appearance.
TODO: Create a compact table comparing domain, minimum input–output distance, and sensitivity to small input changes. Include reflection and wraparound, supported by the preceding calculations. Discuss the distinction between mathematical separation and perceived visibility.
Using previous frames would change the model to something like . This is still a function of its full input tuple. Dependence on history does not itself prove that both requirements can be satisfied; for each fixed history, a continuous map of the whole current RGB cube into itself still has a fixed point.
TODO: Briefly discuss one feasible direction, such as accepting controlled jumps or using an outline. State exactly which original requirement changes. Treat memory as a possible further investigation, not as an established solution.
8. Conclusion
The answer must distinguish the continuous cube from the finite digital grid. The continuous argument identifies an obstruction to positive separation everywhere, while the discrete examples show why exact non-equality and useful contrast are different requirements.
TODO: Answer the research question directly using the completed results. Compare with my original prediction, identify the strongest limitation, and state what I would investigate next. Add no new derivations here.
9. References
TODO: Add the theorem source and sources for any technical or perceptual claims actually used. Cite them at the relevant passages and use one consistent reference style.
10. Appendix, if needed
TODO: Include only supplementary tables or code actually used. Keep essential calculations and figures in the main text. Remove this section if unnecessary.
Editorial notes — remove before submission
Corrections to the original draft
- Introduce and before discussing continuity. Every map on the finite grid is continuous in its inherited metric; digital smoothness needs a quantitative definition.
- The continuous centre is , not
#888888. Reflection sends#888888to#777777, not#878787. - Replace the unsupported “smallest contrast a human eye can see” with a chosen geometric threshold and a clear limitation.
- The colour-wheel idea is omitted from the main sequence because the draft does not define a transformation. If retained, specify the colour model and rule before claiming what happens to grayscale inputs.
- Use “adaptive watermark” unless the output is deliberately restricted to a single colour or grayscale.
- A history-dependent rule is a function when history is included in its domain. It is not automatically a solution to the original universal requirements.
Requirements and scope check
The local requirements guide the definitions, concise progression, worked mathematics, and reflection after each attempt. Personal engagement should come from actual predictions and decisions. Avoid adding difficult mathematics merely for appearance; confirm that the final mathematical depth fits the course and level.
The suggested overall organisation follows Clastify’s format and structure guide, accessed 13 September 2026: introduce the aim, develop the mathematics, evaluate the findings, and cite sources. Final layout and length should be checked against the school’s instructions.
The requested Clastify Math AA criteria page could not be retrieved (HTTP 405). Its contents have not been verified; the A–E criteria in the local requirements were used for this draft.
TODO: Check the criteria page when accessible and confirm course, level, and session. Prioritise correct derivations, labelled figures, and reflection over expanding the page count. Remove these editorial notes and complete the remaining TODOs when preparing the final assessment.