Ideas & Tutorials
Turn One Photo Into a Colour Palette You Can Actually Read
Extract a useful set of colours from one photograph, then check black and white text for readable contrast.

Turn One Photo Into a Colour Palette You Can Actually Read
You've taken a photo with colours you love. Now you want those colours on a label, a market sign or the little website you keep meaning to finish. Picking them by eye is fun until the yellow heading disappears into the background.
Here's a better start: take a real photo, pull out a handful of colours, then check which text is readable on each one. For our example we used Markus Spiske's photograph of yellow flowers against a dark background. We extracted five colours from the actual image and calculated contrast against black and white text. This is a digital example, not a claim that the colours will match every printer or screen.
You can ask ChatGPT to help with the same job using your own photo. You still get the final say over which colours make the design feel right.
What you need
Pick a photo you took or have permission to use. A product, a pet, a favourite room, a garden or a piece of fabric will all work. You'll need a ChatGPT account with image upload; a data-analysis feature that can run code is useful for extracting and checking the actual pixel colours. Availability and limits vary by account. If it can't run the calculation, use an image editor's eyedropper and a separate contrast checker instead.
For this demonstration we used a small Python and OpenCV script on the photograph. We did not use ChatGPT to produce the exact numbers shown here. The complete prompt below asks for the same kind of calculation, but your results can differ because the photo, sampling and method will differ.
1. Choose the part of the photo that matters

The real source photograph by Markus Spiske, shared on Wikimedia Commons under CC0. We resized it for this article.
Look at the picture and decide what you're trying to capture. Is it the dark blue of the shadows, the warm yellow petals or the whole mix? If the thing you care about is a tiny corner of a huge photograph, crop a copy around it before uploading. The computer counts pixels; it doesn't know that the small red flower is your favourite part.
Our image is mostly dark background and golden petals. That means the extracted palette is going to lean dark and yellow. A different crop would produce a different set, and that's not a mistake. It's a decision about which part of the picture is doing the talking.
Keep the original and use a copy for any crop. If your image shows a customer, a home address or private work on the bench, remove anything you don't want to upload.
2. Attach the image and ask for five actual colours
Open ChatGPT and start a new conversation. Use the plus or attachment control near the message box to choose your image. Wait until the image appears in the message before sending a request. The control may look different on a phone or in another version of the app.
Paste this and change the bit in brackets:
Use the attached photo to make a practical five-colour palette for
[a market sign / a website / a product label].
If your data-analysis tools can read the image pixels, calculate five
representative colours from the photo instead of guessing. Show each
colour as a swatch and give its six-digit HEX value. Tell me which
parts of the image the colours roughly represent and whether a large
background is dominating the result.
For every swatch, calculate the contrast ratio for black and for white
text. Show the better of those two choices and its ratio. Flag anything
below 4.5:1 for normal-size text. Don't claim this guarantees my whole
website or printed piece is accessible.
Give me a downloadable palette image if your tools can create one.
If you cannot actually read the pixels or calculate the ratios, say so
and give me a manual alternative. Do not invent measurements.
A HEX value is the six-character colour code used in many digital design tools, such as #C8B957. It is not a guarantee that paint, vinyl or ink will look identical under different lighting.
3. Look at the result before you fall in love with it

Five actual colours from our example, extracted with a fixed-seed clustering calculation. Different tools or crops may choose different values.
Our five values were #1A1D22, #7A622D, #A48D39, #4B402A and #C8B957. The darkest colour came from the background; the warm colours came from the petals and their shadows. We reduced a thumbnail to five representative groups with OpenCV. We didn't ask a model to look at the photo and make up the codes.
Some of these colours are quite similar. That's useful to know, too. Five mathematically distinct swatches don't automatically make five useful roles in a design. You might keep the dark background, one golden middle and the lightest yellow, then add a neutral if you need more breathing room.
4. Put the swatches beside the photograph

Our real photograph and its calculated swatches side by side. This is a palette preview, not a printed colour match.
Compare the set with the image. Does it remind you of the picture, or has it picked five nearly identical shadows? If the result misses the bright detail you wanted, try a closer crop or ask for one manually selected accent as well as the dominant colours.
Try assigning jobs rather than using everything at full strength: one dark for text, one light background, one accent and perhaps a second accent. That gives your eye a place to rest. You can save the remaining swatches for borders or a later design.
If your chat offers a downloadable image, open the file and make sure the codes are readable. If it only describes colours, copy the HEX values into your design app's colour picker and make your own small palette. Keep the photo and the palette together so you can revisit them later.
5. Check the contrast, not just the mood

Actual contrast calculations for black or white text against each extracted swatch. These are digital colour values, not a physical print test.
The W3C contrast guidance uses 4.5:1 as the minimum for most normal-size text under WCAG's minimum-contrast criterion, with a lower threshold for qualifying large text. This is a useful screen-design check, not a promise that every piece of the page is accessible.
For example, white on our dark #1A1D22 is about 16.90:1. Black on the lightest yellow #C8B957 is about 10.53:1. Both are substantially clearer than a pale yellow sentence floating over another pale yellow. The image above shows the calculated better choice between black and white for every swatch.
Check the actual foreground and actual background used in your finished design. Text over a photograph can pass in one corner and disappear in another. Add a solid background behind the words or move them to a clearer area; don't rely on one sampled pixel from a busy image.
What this doesn't tell you
A contrast ratio doesn't check font size, spacing, language, focus controls or the rest of a site's accessibility. It also doesn't predict how a transparent overlay will blend unless you calculate the final displayed colours. Test your real design at the size people will use it and consider a fuller accessibility review when needed.
For a printed label, make a small proof on the actual material if you can. Paper, timber, fabric, ink and lighting can shift the appearance. We haven't printed this palette or matched it to a commercial ink system.
Start with one photo and three colours you would actually use. Put a short piece of text on them, check the contrast and adjust. You now have a palette with a reason to exist, rather than five pretty rectangles sitting in a folder.
Image source: Markus Spiske, Colourful spring flowers, CC0. The palette and comparison images were made from that photo for this example.
Sources
Share this article
Know someone who would enjoy this? Pass it along.
