How do I get hex codes from an image?
Drop the image and every color in the palette shows its hex code. Select a color to copy its code, or download all of them at once as a Hex codes text file or as CSS variables.
To get the exact code of one spot, such as a logo color or a skin tone, click that spot on the image. The color under the pointer is added to the palette as it is, not averaged into a group. On images larger than 1,200 pixels it comes from the scaled copy described below, so pick from the middle of a flat area rather than an edge. You can also type a hex code to add a color the image doesn’t have.
How do I make a Procreate palette from an image?
On the iPad, Procreate can do it itself. The Procreate Handbook lists three ways in the Palettes tab: New from Camera, New from Photos (“Tap a photo and Procreate will create a customized palette from the colors captured within that photo”) and New from File for a JPG or PNG. If you only need a quick palette on the iPad, that is the fastest route.
Use this page instead when:
- You are on a computer, or the reference image is on a computer.
- You want to choose how many colors, drop the ones you don’t need, add a color by clicking it, and put them in order before the palette goes to the iPad.
- You need the same palette in Photoshop, Clip Studio Paint, Krita, GIMP or in code, where Procreate’s palette feature doesn’t help.
Download the .swatches file, send it to the iPad, and drag it into the Palettes tab under Colors.
Which file do I need for Photoshop and other apps?
| App | Download | Import from |
|---|---|---|
| Procreate | .swatches |
Drag it into the Palettes tab under Colors |
| Photoshop | .ase or .aco |
Swatches panel menu > Import Swatches |
| Illustrator, InDesign, Affinity | .ase |
The Swatches panel menu |
| Clip Studio Paint | .aco |
Color Set palette menu > Import color set |
| Krita | .kpl |
Palette docker > Import resources |
| GIMP, Inkscape | .gpl |
Palettes dialog > Import Palette |
| Websites, code, notes | Hex codes or CSS | Paste them |
Procreate’s handbook says it imports a .swatches file by drag and drop into the Palettes tab, and .ase and .aco files through New from File, so the Adobe downloads work on the iPad too. Each color in the Adobe, GIMP and Krita files is named after its hex code. The PNG card is a picture of the palette with the hex code under each color, for a mood board or a client. Moving the palette into Clip Studio Paint or Krita along with your artwork? The guides to opening Procreate files in Clip Studio Paint and in Krita cover the layers.
The procreate-swatch-generator project notes that Procreate swatches “only support up to 30 colors”, which is why the slider stops at 30 and clicking the image stops adding colors once the palette is full.
How does it pick the colors?
It groups pixels by how alike they look, then gives each group’s average color. The steps:
- Every pixel at least half opaque is counted into 32,768 bins (32 levels each of red, green and blue), keeping the exact average color of each bin.
- The bins are compared in OKLab, a color space where equal distances look like roughly equal differences, so two blues that look alike are grouped even if their numbers differ.
- Median cut splits the colors into as many groups as you asked for, always splitting the group with the widest spread.
- A few rounds of k-means move each color to the middle of the pixels nearest to it.
- Each color is the average of its pixels, so a flat area in a drawing comes back as its exact hex code.
Images larger than 1,200 pixels on the longest side are counted on a scaled copy of that size, which keeps it fast on phones. The share shown for each color is the part of the counted pixels nearest to it.
Painting from a reference photo
A palette tells you which colors are in a photo, not how light or dark they are. To see the light and dark pattern of the same reference, run it through the value checker, which shows it in grayscale or in 2 to 5 values, or the notan generator, which cuts it down to flat dark and light shapes.
What this tool doesn’t do
- No color names. Colors are named by hex code, not “dusty rose”. Rename them in your app if you need to.
- No color schemes. It finds the colors that are in the image; it doesn’t invent complementary or analogous colors.
- No RGB, HSL or CMYK lists. The text downloads are hex codes and CSS. The palette files store RGB, and your app shows the other values once imported.
- No print matching. Colors are sRGB as the browser decodes the image. There is no CMYK or Pantone matching, and an image tagged with a wide-gamut profile such as Display P3 is converted to sRGB by the browser first.
- One image at a time. Drop another image to start a new palette.
For a palette file you already have in another format, use the ASE and ACO palette converter. For a palette exported from Procreate, the Procreate swatches converter opens .swatches files.
How this page was tested
On 15 October 2026 we ran the tool in headless Chrome on a Linux desktop with test images we made ourselves:
- Flat colors. A 400 × 100 px PNG with four flat colors covering 40%, 30%, 20% and 10% of it came back as exactly those four hex codes, with those shares, most common first.
- Clicking the image. On a 256 × 200 px test image where each pixel’s red and green values equal its position, clicking five known points added the exact color of each point.
- Transparency. A PNG with one green square on a transparent background gave one color, the green; the background was ignored.
- A large photo-sized file. A 4000 × 3000 px JPG took 0.3 seconds from dropping it to showing 8 colors, decoding included. Moving the slider to 30 colors took 0.2 seconds.
- Procreate and Photoshop files. On 17 October 2026 the two sample
.procreatefiles the converter offers to try gave their palettes in about half a second and about one second, and a layered.psdtest file gave its palette too. A file that ends in.procreatebut isn’t one showed an error instead of a palette. - The downloads. We read every file back with separate readers written from the format descriptions (ZIP and JSON for .swatches, Adobe’s specification for .aco and .ase, plain text and XML for the rest). Every color, in the order we set, matched the palette on screen, and the PNG card showed the same hex values.
We have not yet imported the files into Procreate on an iPad or into Photoshop, Clip Studio Paint, Krita or Affinity themselves.