Color Picker from Image
Upload or paste any image, then click to pick colors. Get HEX, RGB, and HSL values instantly with a magnifier loupe.
How to Use the Image Color Picker
- Load an image β drag and drop an image file onto the drop zone, click to open a file picker, or paste an image from your clipboard with Ctrl+V.
- Pick mode β move your mouse over the image to see the magnifier loupe showing zoomed pixels. Click anywhere to pick that color.
- View color values β the picked color appears as HEX, RGB, HSL, and HSV. Click any Copy button to copy that format.
- Color history β your last 20 picked colors are saved as swatches. Click any swatch to restore that color's values.
- Palette mode β switch to Extract Palette to automatically extract the 6β8 dominant colors from the image. Export them as CSS custom properties.
Why Pick Colors from Images?
Designers and developers frequently need to extract exact color values from existing images β to match brand colors from a logo, to recreate a color scheme from a photograph, to identify the colors used in a competitor's design, or to generate a harmonious color palette inspired by natural photography. Knowing the precise HEX or RGB value is essential for reproducing colors accurately in CSS, design tools, or code.
This tool makes color picking instant and private: your image never leaves your browser, all processing happens locally using the HTML5 Canvas API, and results are available in all common color formats simultaneously.
Understanding Color Formats
Colors can be represented in several different formats, each useful in different contexts:
- HEX (#rrggbb) β the most common format in web development. A six-character hexadecimal code where the first two characters represent red, the next two green, and the last two blue. Used in CSS, HTML, and most design software. Short form (#rgb) can be used when each pair has identical digits (e.g., #ff0000 β #f00).
- RGB (rgb(r, g, b)) β represents color as three integers from 0β255 for red, green, and blue channels. Used in CSS and programming languages. rgb(255, 0, 0) is pure red. RGBA adds an alpha (opacity) channel: rgba(255, 0, 0, 0.5) is 50% transparent red.
- HSL (hsl(h, s%, l%)) β represents color as Hue (0β360Β°), Saturation (0β100%), and Lightness (0β100%). Hue is the color angle on a color wheel (0/360=red, 120=green, 240=blue). Saturation controls intensity. Lightness controls brightness. HSL is more intuitive for generating color variations: increasing lightness creates tints, decreasing creates shades.
- HSV (hsv(h, s%, v%)) β similar to HSL but uses Value (brightness) instead of Lightness. Preferred by many design applications (Photoshop uses HSB which is the same as HSV). In HSV, fully saturated colors are at Value=100%, while in HSL they are at Lightness=50%.
Dominant Color Extraction
The palette extraction feature samples approximately 2,000 pixels distributed evenly across the image in a grid pattern. Similar colors within a certain RGB distance are clustered together, and the most represented color from each cluster is returned. This produces a palette of the most visually prominent colors in the image. The algorithm is intentionally simple compared to professional tools like k-means clustering in full resolution, but it works well for photography and illustration, producing palettes that are representative of the image's actual color distribution.
Using Extracted Colors in CSS
The "Export as CSS Variables" button generates a CSS snippet defining each palette color as a custom property. This makes it easy to build a color system from an existing brand image or photograph. CSS custom properties can then be used throughout your stylesheet with the var() function. For example, after extracting colors from a brand logo, you can define --color-primary, --color-secondary, etc., and reference them in all your styles for easy future updates. Combine this tool with our Tailwind to CSS converter for a complete design-to-code workflow.
Cross-Origin Images
Due to browser security restrictions (CORS β Cross-Origin Resource Sharing), you cannot use getImageData() on a canvas that contains images loaded from a different domain. This means you cannot paste an image URL from another website and pick colors from it. You must download the image first and then upload it or paste it. Images loaded from your local filesystem or pasted from the clipboard are not subject to this restriction and work seamlessly.