Skip to content
Photo to palette · or one base colour

Find the colours that were already there

A photograph already contains a worked-out colour scheme: the light, the shadow and the subject agreed on it. The extractor groups the pixels into a handful of representative colours and hands you the hex codes, ready to paste into a site or a slide deck.

Short answerLast edited October 31, 2026

The Color Palette Extractor pulls a set of colours from a photo, or builds a palette from one base colour, and gives you the hex code for each. The colours are computed from the pixels in your browser, ready to copy into a design tool.

How it works

1

Add the image

Open the photo, screenshot or design you want colours from.

2

Choose the size

Pick how many colours the palette should have.

3

Take the codes

Copy the hex values or save the palette.

A palette from a dusk photograph5 colours
#0B1020Sky
#334155Horizon
#7C3AEDGlow
#F472B6Blush
#FDE68ASand

Dark to light, just like the picture: a near-black sky, a slate horizon, a violet glow, a warm blush and a pale sand highlight. Five colours are enough for a whole landing page.

Grouping thousands of pixels into five

The tool shrinks the picture to a few hundred pixels, throws away fully transparent ones, and then runs k-means: it picks a few starting colours, assigns every pixel to the nearest one, moves each colour to the average of its group, and repeats until nothing moves.

The weighting is perceptual rather than naive: green counts more than red in the distance calculation, because the eye is more sensitive to it and a straight RGB average would blur greens into browns.

The result is ordered by how much of the picture each colour covers, so the most important colour is first. That is a reasonable starting point for a scheme, though the colour you want as an accent is often the smallest group rather than the largest.

  • 4 colours for a simple interface
  • 6 for a landing page or a poster
  • 8 to 10 for an illustration or a chart set

Turning a palette into a usable scheme

LossyBackground

The darkest colour for a dark interface, the lightest for a light one. Everything else is read against it, so it should be a quiet value.

LossyText

Two steps away from the background in brightness, and check the contrast ratio: 4.5:1 for body text is the accessibility floor.

LossyAccent

The most saturated colour in the set. Use it for buttons and links only, so it keeps meaning something.

What the exports contain

ExportFormatUse it for
CSS variables--color-1: #0b1020;Pasting straight into a stylesheet
JSONhex, rgb and hsl per colourDesign tools, scripts, Figma plugins
Click a swatchHex on the clipboardQuick paste into any colour field
Base colour modeTints and shadesBuilding a scale around a brand colour
Which colour should be the accent?

Usually not the most common one. The dominant colour is what the picture is made of — sky, skin, wall — and it works as a background. The accent is the small, saturated outlier: the red of a jacket, the teal of a sign. Look at the swatches with the lowest share and the highest saturation.

Why do the colours look slightly different from the photo?

Each swatch is the average of a group of pixels, so it is by definition a colour that exists between several. That is what makes it usable as a flat fill: a group average is calmer than a single sampled pixel, which may be noise.

What does the base colour mode do?

It ignores any picture and builds a scale around one colour, rotating the hue slightly and moving lightness from dark to light. Use it when you have a brand colour and need backgrounds, borders and hover states that belong to it.

Can I use a transparent PNG?

Yes. Fully transparent pixels are skipped, so the palette describes the artwork rather than the empty corners of the canvas.

Colour questions, answered

Is the image uploaded?
No. The picture is read into a canvas in your browser, sampled and grouped locally. Nothing is sent anywhere, so client artwork and unreleased brand material are safe to use.
How many colours should I extract?
Four for a minimal interface, six for most pages, eight to ten when you also need chart colours or illustration tones. More than ten starts to look like a photograph rather than a scheme.
Does it remove the background before sampling?
Not automatically. A photo with a large plain background will devote most of the palette to that background. Crop to the interesting part of the picture first, and the palette becomes about the subject.
Can I get matching darker and lighter versions?
Yes — switch to the base colour mode, choose the colour you extracted and the tool builds a full scale around it, from a dark background to a light highlight.
Are the values CMYK or Pantone?
No, this is screen colour. Hex, RGB and HSL are exact; a CMYK conversion depends on the printer profile, and a Pantone match is a physical decision. Give the hex codes to your printer and they will match them.
Is it free to use the palette?
Yes. Colours themselves cannot be copyrighted, and the tool adds nothing to what the picture contains. Check the rights of the photograph if you intend to reuse the image itself, not the colours.

How to Build a Colour Scheme From a Photograph

Most colour schemes fail for the same reason: they are chosen in isolation. A brand colour is picked from a mood board, then a background, then a text colour, and the three never spend a moment in the same picture. Photographs do not have this problem. A landscape at dusk is a palette that has already survived the light, the atmosphere and the eye of the person who took it, which is why extracting colour from an image is a better starting point than inventing it.

The extraction itself is a clustering problem. Every pixel of a picture is a point in a three-dimensional space of red, green and blue. The task is to place a small number of representative points — five, six, eight — so that every pixel is close to one of them. K-means does this by iteration: choose starting points, assign each pixel to the nearest, move each point to the average of its cluster, repeat. After a few rounds the points stop moving and the palette exists.

Why the distance calculation is not plain RGB

A naive implementation averages red, green and blue equally, which does not match human vision. The eye is most sensitive to green, then red, and least to blue, so the distance formula weights them roughly 0.3, 0.59 and 0.11. Without those weights, greens drift toward brown and skin tones toward grey, and the palette looks muddier than the photograph.

The other trick is sampling. Two hundred thousand pixels carry no more information about the palette than three thousand do, and k-means cost grows with the number of points. Shrinking the image and stepping through it produces the same result in a fraction of the time.

From palette to interface

A scheme needs three roles before it needs ten colours. The background is the quietest value — the darkest swatch for a dark interface, the lightest for a light one. The text colour sits at least two brightness steps away from it, and the contrast ratio between them should reach 4.5 to 1 for body text; anything less is unreadable in daylight on a phone. The accent is the most saturated colour of the set, reserved for buttons, links and one or two highlights.

The remaining colours do the supporting work: borders, hover states, chart series, illustration fills. A palette of six usually resolves into two backgrounds (page and card), two text values (primary and secondary) and two accents. That is a complete interface, and it came from a single photograph.

Practical rules that save you later

  • Extract from the part of the picture you actually like — crop out that distracting foreground first.
  • Trust the order: the largest group is usually a background, not an accent.
  • Never use two accents of similar saturation next to each other; the eye cannot tell which one is the action.
  • Test the palette on a screenshot, not on a swatch page. Colours behave differently when they hold text.

Finally, keep the source. Write the hex codes into your stylesheet as named variables and note which photograph they came from. Six months later, when you need a seventh colour, you can go back to the same picture and extend the scheme instead of guessing at a new one.

Contrast is the part a palette cannot fix by itself

A pair of colours that looks lovely on a swatch page can be unreadable as text. Contrast is a ratio between the relative luminance of two colours, and the guideline for body text is 4.5 to 1; large headings can go down to 3 to 1. The practical consequence is simple: whatever the photograph gives you, the text colour is usually not one of its saturated tones but a near-black or near-white derived from the background.

That is why a palette of six works better as two backgrounds, two text values and two accents than as six equally weighted colours. When a brand insists on coloured text, keep it for short labels and put the paragraphs in the neutral value.

Keeping a palette alive

Colours drift. A new image on the home page, a seasonal banner, one designer's monitor calibrated differently, and within a year the site has nine greens. The defence is boring and effective: name the variables in the stylesheet, forbid raw hex codes in components, and review the palette twice a year against a single reference image. A palette that is documented survives; one that lives in a mood board does not.

It is also worth recording the source photograph and the extraction settings next to the variables. When the next person needs a colour for a hover state, they can reproduce the same palette in a minute instead of inventing a tenth green.

More image tools for designers

Video to Audio ExtractorSave the sound of MP4, MOV and WebM videos as MP3 right in your browser.No uploadFreeOpen tool Audio Format ConverterBatch convert between MP3, WAV, M4A, FLAC, OGG and OPUS.No uploadFreeOpen tool MP3 Cutter & Ringtone StudioTrim any part of a song, add fades and make a ringtone.No uploadFreeOpen tool Audio MergerCombine several audio files into one track with smooth transitions.No uploadFreeOpen tool Audio Loudness BoosterMake quiet recordings louder and normalize them to a standard level.No uploadFreeOpen tool Slowed + Reverb StudioCreate slowed + reverb, sped up and nightcore versions of songs.No uploadFreeOpen tool Background Noise RemoverClean hum, fan and traffic noise from voice recordings.No uploadFreeOpen tool Pitch ShifterRaise or lower the pitch by up to an octave and keep the running time exactly as it was.No uploadFreeOpen tool Silence RemoverCut the dead air out of interviews, lectures and voice notes and see how much shorter the file gets.No uploadFreeOpen tool Audio EqualizerCut mud, lift speech and add air with a 10-band equalizer and six presets.No uploadFreeOpen tool Audio Reverb EffectAdd room, studio, hall or plate space with control over decay and wet mix.No uploadFreeOpen tool Audio Chorus EffectDouble a take with two or three drifting voices and stereo width.No uploadFreeOpen tool Audio Fade In/OutWrite smooth fade ins and fade outs of any length into the file itself.No uploadFreeOpen tool Stereo to Mono ConverterFold stereo to mono, keep one channel or swap left and right.No uploadFreeOpen tool Audio NormalizerEven out volume with peak or average normalization and a no-clip safety.No uploadFreeOpen tool Video Caption MakerCreate captions with AI or use an SRT file and burn them into the video.No uploadFreeOpen tool Video to Text ConverterTurn the speech of videos and recordings into text and SRT subtitles.No uploadFreeOpen tool AI Video Summary GeneratorGet the summary, chapters and notes of long videos, lectures and podcasts.AIFreeOpen tool Video Size ReducerShrink a video to the size you need for Discord, email or WhatsApp.No uploadFreeOpen tool GIF Maker & Video CutterCut part of a video and save it as a GIF or a shorter MP4.No uploadFreeOpen tool Vertical Video ConverterTurn 16:9 videos into 9:16 vertical format with a blurred background.No uploadFreeOpen tool Video Frame ExtractorSave any frame of a video as a full-resolution image.No uploadFreeOpen tool Video Metadata ViewerSee the resolution, bitrate, codec and FPS of a video file.No uploadFreeOpen tool AI Clip MakerAI finds the best moments of a long video and turns them into captioned vertical clips.AIFreeOpen tool AI Video EnhancerEnhance video quality, upscale resolution and reduce noise with AI.AIFreeOpen tool Auto Captions GeneratorGenerate accurate captions and subtitles for videos automatically.AIFreeOpen tool Smart Video TrimmerTrim videos with frame-accurate precision in your browser.No uploadFreeOpen tool Video Loop MakerCreate seamless looping videos for GIFs and social media.No uploadFreeOpen tool VTT Subtitle GeneratorGenerate WebVTT subtitle files from video transcripts.No uploadFreeOpen tool Video CropperCrop videos to focus on important areas or change aspect ratio.No uploadFreeOpen tool Image Format ConverterConvert between JPG, PNG and WebP and shrink the file with a quality slider.No uploadFreeOpen tool Social Image ResizerFit photos to Instagram, YouTube, TikTok and X sizes in one click.No uploadFreeOpen tool HEIC Photo ConverterBatch convert iPhone HEIC photos to JPG or PNG.No uploadFreeOpen tool EXIF & GPS RemoverDelete the GPS location and camera data of a photo before you share it.No uploadFreeOpen tool Watermark MakerAdd your @handle or logo to photos and videos.No uploadFreeOpen tool Instagram Grid & Carousel MakerSplit a wide photo into a seamless carousel or a profile grid.No uploadFreeOpen tool AI Video Idea FinderTen filmable video ideas with a hook and a reason, plus three series concepts.AIFreeOpen tool AI Title & Tag WriterWrite titles, descriptions and tags for YouTube, TikTok, Reels and more.AIFreeOpen tool AI Caption & Bio WriterCaptions, hashtag sets and bios that fit every platform limit.AIFreeOpen tool AI Hook & Script WriterHooks that grab viewers in the first second and timed shooting scripts.AIFreeOpen tool AI Channel Name IdeasMemorable name ideas for Instagram, TikTok, YouTube, X and Twitch.AIFreeOpen tool AI Meta Description GeneratorWrite title tags and meta descriptions that fit Google and earn the click.AIFreeOpen tool AI Product Description WriterTurn a spec sheet into three product descriptions, benefit bullets and search phrases.AIFreeOpen tool AI Blog Outline GeneratorPlan an article that answers the search: headlines, headings, word budget, FAQ and internal links.AIFreeOpen tool AI Podcast Show Notes GeneratorTurn an episode transcript into a summary, six takeaways, chapters, quotes, titles and tags.AIFreeOpen tool AI Text RewriterRewrite a text shorter, simpler, more formal or more persuasive, and see exactly what changed.AIFreeOpen tool AI TranslatorTranslate between seven languages and keep the register: formal, neutral or informal.AIFreeOpen tool AI FAQ GeneratorWrite the questions customers actually ask, with answers, follow-ups and FAQ schema for the page.AIFreeOpen tool AI Storyboard GeneratorTurn an idea into a timed shot list you can film alone: framing, action, on-screen text and voiceover.AIFreeOpen tool Social Keyword FinderFind the phrases and questions people search inside Instagram, TikTok, YouTube and Pinterest.AIFreeOpen tool Image CompressorShrink photos to a target size for a form, an email or a shop page, without leaving the browser.No uploadFreeOpen tool Favicon & App Icon GeneratorMake every icon a site needs: 16 to 512 pixels, a real favicon.ico and the HTML to paste.No uploadFreeOpen tool Image CropperCrop a photo to a social size, a cover or a profile picture by dragging the frame.No uploadFreeOpen tool Image to PDFTurn photos and scans into one PDF: page size, orientation, margin and page order.No uploadFreeOpen tool Passport & ID Photo MakerCrop a photo to passport, visa or ID sizes with a head-height guide and print it on one sheet.No uploadFreeOpen tool Meme GeneratorPut a caption on any picture: four layouts, outlined type and a square export for every feed.No uploadFreeOpen tool AI Background RemoverRemove backgrounds from images instantly with AI.AIFreeOpen tool AI Image UpscalerUpscale images up to 4x while enhancing details with AI.AIFreeOpen tool AI Object RemoverErase unwanted objects, people or text from photos.AIFreeOpen tool AI Image GeneratorCreate stunning AI images from text prompts in seconds.AIFreeOpen tool AI Avatar GeneratorGenerate unique AI avatars from photos or text descriptions.AIFreeOpen tool AI Logo GeneratorGenerate a logo mark from a description and set your brand name in type, ready for a PNG.AIFreeOpen tool Image to Text OCRExtract text from images and scanned documents with high accuracy.AIFreeOpen tool Color Palette ExtractorExtract color palettes from any image automatically.No uploadFreeOpen tool Face Blur ToolAutomatically blur faces in photos for privacy protection.No uploadFreeOpen tool WebP Image ConverterConvert images to and from WebP format for better web performance.No uploadFreeOpen tool Image to Video MakerTurn photos into a slideshow video with pan, zoom and crossfades.No uploadFreeOpen tool AI Blog WriterGenerate complete blog posts with SEO optimization in seconds.AIFreeOpen tool AI Article GeneratorCreate high-quality articles on any topic with AI assistance.AIFreeOpen tool AI Email WriterWrite professional emails for any purpose instantly.AIFreeOpen tool AI Ad Copy GeneratorGenerate compelling ad copy for Google, Facebook, and more.AIFreeOpen tool AI Product Review GeneratorCreate authentic product reviews for any item.AIFreeOpen tool AI SEO Content WriterWrite SEO-optimized content that ranks higher on search engines.AIFreeOpen tool AI ParaphraserRephrase text while maintaining meaning and tone.AIFreeOpen tool AI Grammar CheckerFix grammar, spelling, and punctuation errors instantly.AIFreeOpen tool AI Resume BuilderCreate professional resumes tailored to any job.AIFreeOpen tool AI Cover Letter WriterWrite personalized cover letters for job applications.AIFreeOpen tool AI Business Name GeneratorFind the perfect name for your business or brand.AIFreeOpen tool AI Slogan GeneratorCreate catchy slogans and taglines for your brand.AIFreeOpen tool AI Hashtag GeneratorGenerate trending hashtags for social media posts.AIFreeOpen tool AI Question GeneratorCreate quiz questions and study materials with AI.AIFreeOpen tool AI Testimonial GeneratorGenerate authentic customer testimonials for your business.AIFreeOpen tool AI Press Release GeneratorWrite professional press releases in minutes.AIFreeOpen tool AI LinkedIn Post GeneratorCreate engaging LinkedIn posts that drive engagement.AIFreeOpen tool AI Twitter Thread GeneratorTurn ideas into viral Twitter/X threads.AIFreeOpen tool AI Poem GeneratorGenerate beautiful poems for any occasion.AIFreeOpen tool PDF MergerCombine several PDFs into one file, in the order you choose.No uploadFreeOpen tool PDF SplitterExtract page ranges from a PDF or save every page as its own file.No uploadFreeOpen tool PDF CompressorMake a heavy PDF small enough to send, without uploading it.No uploadFreeOpen tool PDF to Image ConverterSave every page of a PDF as a JPG or PNG at screen, print or 300 dpi quality.No uploadFreeOpen tool PDF Page OrganizerRotate, delete and reorder the pages of a PDF, then save one clean new file.No uploadFreeOpen tool Sign a PDFDraw or upload your signature, place it on the page and download the signed PDF.No uploadFreeOpen tool Unlock PDFRemove password protection from PDF files.No uploadFreeOpen tool Protect PDFAdd password protection to PDF files.No uploadFreeOpen tool Rotate PDF PagesRotate PDF pages individually or all at once.No uploadFreeOpen tool BMI CalculatorCalculate Body Mass Index and healthy weight range.No uploadFreeOpen tool Calorie CalculatorCalculate daily calorie needs based on age, weight, and activity.No uploadFreeOpen tool Loan CalculatorCalculate loan payments, interest, and amortization.No uploadFreeOpen tool Mortgage CalculatorCalculate mortgage payments and total interest.No uploadFreeOpen tool Percentage CalculatorCalculate percentages, increases, and decreases easily.No uploadFreeOpen tool Age CalculatorCalculate exact age in years, months, and days.No uploadFreeOpen tool Unit ConverterConvert between length, weight, temperature, and more.No uploadFreeOpen tool Tip CalculatorCalculate tips and split bills easily.No uploadFreeOpen tool Discount CalculatorCalculate discounts, sale prices, and savings.No uploadFreeOpen tool BMR CalculatorCalculate Basal Metabolic Rate and TDEE.No uploadFreeOpen tool Video Bitrate CalculatorTurn a target file size and a running time into the bitrate to export with.No uploadFreeOpen tool Video Size & Upload TimeSee how big a video will be, which apps accept it and how long the upload takes.No uploadFreeOpen tool Aspect Ratio CalculatorConvert 16:9, 9:16, 4:5 and any custom ratio into exact pixel sizes.No uploadFreeOpen tool Cool Text GeneratorBold, italic, script and 20+ text styles to copy into bios and captions.No uploadFreeOpen tool Social Character CounterCount characters, hashtags and emojis against every platform limit.No uploadFreeOpen tool Creator Earnings CalculatorEstimate ad and sponsorship income on YouTube, TikTok and Instagram.No uploadFreeOpen tool Sponsorship Rate CalculatorTurn followers, views, engagement and niche into a price range to quote a brand.No uploadFreeOpen tool Engagement Rate CheckerCalculate your engagement rate and compare it with typical rates.No uploadFreeOpen tool YouTube Thumbnail TesterSee how your thumbnail and title look on the YouTube home page and on phones.No uploadFreeOpen tool Vertical Video Safe Zone CheckerCheck that text and faces are not hidden under the app buttons.No uploadFreeOpen tool CTR CalculatorCalculate click-through rates and optimize campaigns.No uploadFreeOpen tool CPM CalculatorCalculate cost per mille and campaign costs.No uploadFreeOpen tool CPC CalculatorCalculate cost per click for advertising campaigns.No uploadFreeOpen tool ROI CalculatorCalculate return on investment for campaigns.No uploadFreeOpen tool RPM CalculatorCalculate revenue per mille for content monetization.No uploadFreeOpen tool Hashtag Performance CalculatorAnalyze hashtag performance and reach potential.No uploadFreeOpen tool Best Posting Time CalculatorFind optimal posting times for maximum engagement.No uploadFreeOpen tool Influencer Value CalculatorCalculate your influencer marketing value.No uploadFreeOpen tool Content Value CalculatorEstimate the monetary value of your content.No uploadFreeOpen tool Collaboration Rate CalculatorCalculate fair rates for brand collaborations.No uploadFreeOpen tool

Quick facts

  1. A palette sampled from a photo reproduces its mood; a palette generated from one colour is built for contrast and consistency.
  2. WCAG AA asks for a contrast ratio of 4.5:1 for body text, which is the number to check before pairing two colours from a palette.
  3. An untagged image is assumed to be sRGB, so a picture in Display P3 looks duller once its profile is dropped.International Color Consortium
  4. Stripping metadata and stripping the colour profile are two different operations: the first removes privacy data, the second changes colour.International Color Consortium
  5. The canvas specification defines toBlob and toDataURL for exporting the drawing, and the format and quality are chosen at export time.WHATWG

Questions people ask

How do I get a colour palette from a photo?
Load the photo and choose how many colours you want, such as five or six. The extractor groups the pixels by colour and shows the dominant ones with their hex codes. Copy the codes into your design tool.
What contrast ratio should text on a colour have?
The WCAG AA level asks for at least 4.5 to 1 for normal body text and 3 to 1 for large text. Check any pair from the palette with a contrast checker before you use it for text on a website or an app.
Why do my palette colours look different on screen and in print?
Screens show colour as light, and print uses inks, so the same hex code can look different on paper. Use an ICC profile for the printer, and proof a sample before printing a large run.

What this page is about

  • ICC colour profile

    A file that describes how the colours of an image map to a device, defined by the International Color Consortium.

  • The HTML element that gives a page a pixel buffer to draw on and export as PNG, JPEG or WebP.

  • A lossless image format defined by the W3C with an 8-bit alpha channel and gamma information, designed for the web in 1996.

Continue with the same file

Each of these opens what the tool above produces. Use “Use in another tool” under the result to carry the file over — it moves from tab to tab inside your browser, never to a server.

Switched-off tools are not listed here: only what works right now.

How would you rate Color Palette Extractor?Be the first to rate it