{"course":{"slug":"ai-images","title":"Image Generation, in Practice","url":"https://addaly.com/learn/ai-images","level":"beginner","track":"create"},"lesson":{"slug":"brand-colour-is-a-constraint","title":"A hex value is not something a diffusion model can hit","url":"https://addaly.com/learn/ai-images/brand-colour-is-a-constraint","position":17,"of":69,"minutes":8,"answer":"Diffusion models cannot be instructed to produce an exact colour, so brand colour is achieved by generating in a neutral or near palette and then grading or compositing the exact value in afterwards.","keyIdea":"Diffusion models cannot be instructed to produce an exact colour, so brand colour is achieved by generating in a neutral or near palette and then grading or compositing the exact value in afterwards."},"body":{"format":"markdown","text":"## #E4002B, and why asking does not work\n\nA brand guideline says the red is #E4002B. You put that in the prompt. You get a red. It is not that red, and it is not the same red twice.\n\nThe reason is structural. The prompt goes through a text encoder that turns it into a semantic embedding: a representation of meaning. \"#E4002B\" is tokenised into fragments that carry no reliable meaning, and even \"crimson red\" is a region of colour space rather than a coordinate. The model then denoises toward an image consistent with that meaning, with every pixel influenced by lighting, material, white balance and the rest of the scene. There is no path in that architecture by which a specific RGB triple can be requested.\n\nThis is worth understanding rather than just accepting, because it tells you where the control actually is: **after generation, in pixel space**, where a colour is just a number you can set.\n\n## Four ways to get the exact colour\n\n**One: generate neutral, grade after.** The most reliable method. Generate the scene with the element in a plain, slightly desaturated version of the colour, then correct it in an editor. In GIMP or Photopea, select the region, and use Curves or Hue-Saturation to move it. For a flat surface, a solid-colour layer in Colour blend mode over a mask lands the value exactly while keeping the original shading.\n\n**Two: composite the element.** If the brand colour belongs to an object with a defined shape (a packet, a bottle, a chair) put the real thing in. This is the product workflow from later in the course and it solves colour as a side effect.\n\n**Three: condition on a colour block.** Paint flat shapes of the right colours in GIMP or Krita, then run that image through img2img at low denoise, around 0.3 to 0.45. The composition and palette survive; the model adds material and light. This is the best method when the brand colour must be distributed across a whole scene rather than on one object.\n\n**Four: accept approximate and say so.** For background atmosphere and incidental colour, \"in the region of the brand palette\" is usually fine, and pretending otherwise creates work nobody asked for. Ask which elements are strictly specified. Usually it is two.\n\n## The thing that surprises people\n\nEven after you set the exact hex, it will look wrong in context. A pure brand red surrounded by warm generated light reads as orange-shifted; the same red on a cool background reads pink. This is simultaneous contrast and it is a property of human vision, not a colour error.\n\nWhich means grading the whole image matters as much as the swatch. If the generated scene is warm and the brand palette is cool, you either grade the scene toward the palette or you have a permanent argument about whether the colour is right. Do that first and match the specific element second.\n\n## Print makes it worse, and it is better to know now\n\nIf the image is going to print, the brand colour may be defined as a spot ink that no CMYK press can reproduce, let alone your screen. A vivid brand orange or a deep navy frequently shifts visibly when converted. That is a standard print problem rather than a generation problem, and the vector-and-print course in this catalogue covers the conversion properly, but the timing matters here: you want to know before you spend two hours matching a screen colour that the press cannot hit.\n\n## A free toolchain that does all of this\n\nNone of it needs paid software.\n\n- **GIMP**: Curves, Hue-Saturation, selection by colour, layer blend modes.\n- **Krita**: better painting tools for making colour-block conditioning images.\n- **Photopea**: runs in a browser, reads and writes PSD, useful when you are on a borrowed machine.\n- **Inkscape**: for placing exact flat brand colours as vector shapes over a generated plate, which is how most logos and blocks of brand colour should arrive anyway.\n\nThe rule underneath all four methods is the same: **use the generator for light, material and form; use pixel-editing tools for exact values.** Trying to make a diffusion model do arithmetic on colour is spending hours on something a colour picker does in one click."},"check":{"question":"Why can a diffusion model not reliably produce an exact hex colour on request?","options":[{"text":"Because the text encoder turns the prompt into a semantic embedding, so there is no channel by which a specific numeric value reaches the pixels.","correct":true},{"text":"Because the VAE decode from latent space to pixels applies a colour transform that shifts values away from whatever the sampler produced during denoising.","correct":false,"tempting":"The decoder is not colour-accurate in a strict sense, but it is not the barrier; the value never existed as a target in the first place, so there is nothing for a transform to shift."},{"text":"Because the model's training captions almost never contained hex codes, so more examples of colour-coded captions would eventually make the request work.","correct":false,"tempting":"Treats a representational limit as a data gap; even a perfectly captioned dataset leaves colour as a distribution over lighting and material rather than a settable coordinate."},{"text":"Because guidance scale controls saturation as well as prompt adherence, so any specified colour drifts as the guidance value changes between generations.","correct":false,"tempting":"Guidance does affect saturation, which makes this feel right, but the mismatch appears at every guidance value including ones where saturation is well behaved."}]},"prev":{"slug":"the-forbidden-list","title":"Write down what must not appear","url":"https://addaly.com/learn/ai-images/the-forbidden-list"},"next":{"slug":"one-image-or-a-set","title":"One hero or twelve pieces is a different job","url":"https://addaly.com/learn/ai-images/one-image-or-a-set"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'A hex value is not something a diffusion model can hit', in Image Generation, in Practice. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-images/brand-colour-is-a-constraint (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"A hex value is not something a diffusion model can hit","courseTitle":"Image Generation, in Practice","module":{"index":2,"slug":"the-brief","title":"From a request to a specification you can generate against"},"answer":null,"keyIdea":"Diffusion models cannot be instructed to produce an exact colour, so brand colour is achieved by generating in a neutral or near palette and then grading or compositing the exact value in afterwards.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"e4002b-and-why-asking-does-not-work","runs":[{"text":"#E4002B, and why asking does not work"}]},{"t":"p","runs":[{"text":"A brand guideline says the red is #E4002B. You put that in the prompt. You get a red. It is not that red, and it is not the same red twice."}]},{"t":"p","runs":[{"text":"The reason is structural. The prompt goes through a text encoder that turns it into a semantic embedding: a representation of meaning. “#E4002B” is tokenised into fragments that carry no reliable meaning, and even “crimson red” is a region of colour space rather than a coordinate. The model then denoises toward an image consistent with that meaning, with every pixel influenced by lighting, material, white balance and the rest of the scene. There is no path in that architecture by which a specific RGB triple can be requested."}]},{"t":"p","runs":[{"text":"This is worth understanding rather than just accepting, because it tells you where the control actually is: "},{"text":"after generation, in pixel space","b":true},{"text":", where a colour is just a number you can set."}]},{"t":"h2","id":"four-ways-to-get-the-exact-colour","runs":[{"text":"Four ways to get the exact colour"}]},{"t":"p","runs":[{"text":"One: generate neutral, grade after.","b":true},{"text":" The most reliable method. Generate the scene with the element in a plain, slightly desaturated version of the colour, then correct it in an editor. In GIMP or Photopea, select the region, and use Curves or Hue-Saturation to move it. For a flat surface, a solid-colour layer in Colour blend mode over a mask lands the value exactly while keeping the original shading."}]},{"t":"p","runs":[{"text":"Two: composite the element.","b":true},{"text":" If the brand colour belongs to an object with a defined shape (a packet, a bottle, a chair) put the real thing in. This is the product workflow from later in the course and it solves colour as a side effect."}]},{"t":"p","runs":[{"text":"Three: condition on a colour block.","b":true},{"text":" Paint flat shapes of the right colours in GIMP or Krita, then run that image through img2img at low denoise, around 0.3 to 0.45. The composition and palette survive; the model adds material and light. This is the best method when the brand colour must be distributed across a whole scene rather than on one object."}]},{"t":"p","runs":[{"text":"Four: accept approximate and say so.","b":true},{"text":" For background atmosphere and incidental colour, “in the region of the brand palette” is usually fine, and pretending otherwise creates work nobody asked for. Ask which elements are strictly specified. Usually it is two."}]},{"t":"h2","id":"the-thing-that-surprises-people","runs":[{"text":"The thing that surprises people"}]},{"t":"p","runs":[{"text":"Even after you set the exact hex, it will look wrong in context. A pure brand red surrounded by warm generated light reads as orange-shifted; the same red on a cool background reads pink. This is simultaneous contrast and it is a property of human vision, not a colour error."}]},{"t":"p","runs":[{"text":"Which means grading the whole image matters as much as the swatch. If the generated scene is warm and the brand palette is cool, you either grade the scene toward the palette or you have a permanent argument about whether the colour is right. Do that first and match the specific element second."}]},{"t":"h2","id":"print-makes-it-worse-and-it-is-better-to-know-now","runs":[{"text":"Print makes it worse, and it is better to know now"}]},{"t":"p","runs":[{"text":"If the image is going to print, the brand colour may be defined as a spot ink that no CMYK press can reproduce, let alone your screen. A vivid brand orange or a deep navy frequently shifts visibly when converted. That is a standard print problem rather than a generation problem, and the vector-and-print course in this catalogue covers the conversion properly, but the timing matters here: you want to know before you spend two hours matching a screen colour that the press cannot hit."}]},{"t":"h2","id":"a-free-toolchain-that-does-all-of-this","runs":[{"text":"A free toolchain that does all of this"}]},{"t":"p","runs":[{"text":"None of it needs paid software."}]},{"t":"ul","items":[[{"text":"GIMP","b":true},{"text":": Curves, Hue-Saturation, selection by colour, layer blend modes."}],[{"text":"Krita","b":true},{"text":": better painting tools for making colour-block conditioning images."}],[{"text":"Photopea","b":true},{"text":": runs in a browser, reads and writes PSD, useful when you are on a borrowed machine."}],[{"text":"Inkscape","b":true},{"text":": for placing exact flat brand colours as vector shapes over a generated plate, which is how most logos and blocks of brand colour should arrive anyway."}]]},{"t":"p","runs":[{"text":"The rule underneath all four methods is the same: "},{"text":"use the generator for light, material and form; use pixel-editing tools for exact values.","b":true},{"text":" Trying to make a diffusion model do arithmetic on colour is spending hours on something a colour picker does in one click."}]}],"check":{"question":[{"text":"Why can a diffusion model not reliably produce an exact hex colour on request?"}],"options":[{"text":[{"text":"Because the text encoder turns the prompt into a semantic embedding, so there is no channel by which a specific numeric value reaches the pixels."}],"correct":true,"tempting":null},{"text":[{"text":"Because the VAE decode from latent space to pixels applies a colour transform that shifts values away from whatever the sampler produced during denoising."}],"correct":false,"tempting":[{"text":"The decoder is not colour-accurate in a strict sense, but it is not the barrier; the value never existed as a target in the first place, so there is nothing for a transform to shift."}]},{"text":[{"text":"Because the model’s training captions almost never contained hex codes, so more examples of colour-coded captions would eventually make the request work."}],"correct":false,"tempting":[{"text":"Treats a representational limit as a data gap; even a perfectly captioned dataset leaves colour as a distribution over lighting and material rather than a settable coordinate."}]},{"text":[{"text":"Because guidance scale controls saturation as well as prompt adherence, so any specified colour drifts as the guidance value changes between generations."}],"correct":false,"tempting":[{"text":"Guidance does affect saturation, which makes this feel right, but the mismatch appears at every guidance value including ones where saturation is well behaved."}]}],"order":[1,3,0,2],"why":null},"prev":{"slug":"the-forbidden-list","title":"Write down what must not appear","minutes":7},"next":{"slug":"one-image-or-a-set","title":"One hero or twelve pieces is a different job","minutes":7}}}