Get Hex Codes from an Image
A hex code is a 6-digit hexadecimal representation of a color (e.g. #3B82F6) used in CSS, design tools, and every major programming language. PhotoTones is a free hex code picker from image that returns up to 12 ready-to-paste hex values per photo — processed entirely in your browser.
Pull Hex Codes in 3 Steps
- Go to phototones.com
- Upload any JPG, PNG, WebP, or other image file
- Click "Generate Color Palette" — click any swatch to copy its hex, or use "Copy All HEX" for the full set
Open the hex code picker
Free, private, up to 12 hex codes per image.
Open the Color Palette from Image GeneratorUse the Hex Codes in Your Workflow
In CSS
:root {
--brand-vibrant: #3B82F6;
--brand-dark: #1E3A8A;
--brand-light: #DBEAFE;
--brand-muted: #64748B;
}
.button {
background: var(--brand-vibrant);
color: #ffffff;
}
In Tailwind CSS
PhotoTones Pro exports a ready-to-paste tailwind.config.js snippet:
module.exports = {
theme: {
extend: {
colors: {
'palette-vibrant': '#3B82F6',
'palette-dark-vibrant': '#1E3A8A',
'palette-light-vibrant': '#DBEAFE',
'palette-muted': '#64748B'
}
}
}
}
In Figma / Sketch
Hex codes paste directly into the color field of any fill or stroke. For Figma specifically, paste the hex into the color picker's hex input — no leading # needed.
In SCSS
$palette-vibrant: #3B82F6;
$palette-dark-vibrant: #1E3A8A;
$palette-light-vibrant: #DBEAFE;
$palette-muted: #64748B;
Converting Hex to Other Formats
PhotoTones also returns RGB and HSL for every color, so you can copy whichever format your tool expects:
- Hex:
#3B82F6— used in CSS, HTML, Figma, Photoshop, virtually all design tools - RGB:
rgb(59, 130, 246)— useful when you need alpha compositing viargba() - HSL:
hsl(217, 91%, 60%)— ideal for programmatically generating tints and shades in a design system
Hex Code FAQ
What does a hex code represent?
A hex code is a hexadecimal (base-16) encoding of an RGB color. The six digits split into three pairs: red, green, and blue, each ranging from 00 (0) to FF (255). #3B82F6 means red=59, green=130, blue=246.
Are shorthand hex codes supported?
PhotoTones always returns full 6-digit hex codes (e.g. #FF3366, not #F36). Full codes are the safer choice — most design tools and color profilers prefer the explicit form.
Can I get 8-digit hex codes (with alpha)?
Extracted colors are opaque by design. If you need alpha, convert the hex to rgba(r, g, b, alpha) in your CSS — PhotoTones gives you the RGB values alongside hex.
How many hex codes can I pull from one image?
Up to 6 on the free plan; 8, 10, or 12 on PhotoTones Pro using the hybrid Vibrant.js + ColorThief extraction.