Image histogram for RGB and luminance
See the histogram of an image in your browser. Choose a photo or graphic, and the tool counts every decoded pixel at each level from 0 to 255 for red, green, blue and luminance. Switch the chart between channels, read the exact counts in a table, and copy or download them as CSV.
Files stay on your device
How to make a histogram of an image
Select Choose image, or drop a file on the first panel. The line under the button then shows the file name, its size in pixels and its file size. Pick a Transparency option and a Bins count of 256, 64 or 16, then select Analyze image. The status line under the buttons says when the counts are ready.
The chart appears in the Histogram panel. The cards below it show dimensions, counted pixels and ignored transparent pixels. Channel switches between RGB overlay, Red, Green, Blue and Luminance, and Scale switches between Linear and Logarithmic, without a recount. Changing Transparency or Bins clears the result until you analyze again, and Reset clears the image and every setting.
- Choose the image to count
Select Choose image or drop a file in the image panel. Check its name and decoded dimensions.
- Set Transparency and Bins
Ignore fully transparent pixels, or count a white or black background. Choose 256, 64 or 16 bins.
- Analyze the decoded pixels
Select Analyze image to count every decoded pixel. Read the dimensions, counted pixels and ignored pixels below the chart.
- Explore and save the counts
Pick a Channel and Scale, or open Exact counts by bin. Copy CSV or Download CSV exports all four channels.
How to read an image histogram
The horizontal axis runs from 0 on the left to 255 on the right, the full range of an 8-bit channel. The height of each bar is the number of pixels at that value. In the Luminance view 0 is black and 255 is white, so a dark photo piles its bars on the left and a bright one on the right.
A tall bar at either end means many pixels sit at the limit of the range. In a test image of four dark pixels, all four luminance counts land in the first of 16 bins, 0 to 15. Each channel adds up to the number of counted pixels. The RGB overlay draws three separate distributions on top of each other; it does not add them into one total.
Logarithmic plots log(1 + count), which lifts short bars next to a tall peak, and the counts stay the same. On a computer, hold the pointer over a bar to see its range and exact count.
How luminance is calculated
Luminance is linear-light relative luminance, rounded to a whole number from 0 to 255. Each channel value is divided by 255 and linearized: a value at or below 0.04045 is divided by 12.92, and any other value becomes ((value + 0.055) / 1.055) raised to the power 2.4. The tool then adds 0.2126 times red, 0.7152 times green and 0.0722 times blue, multiplies by 255 and rounds.
This is not an average of R, G and B. Mid gray at 128 in every channel gives luminance 55, because linear light sits far below the encoded value. Pure green gives 182, pure red 54 and pure blue 18, since green carries the largest weight, while black gives 0 and white gives 255. The formula is written into the CSV, so a spreadsheet or a script can check each value against it.
Bins and transparent pixels
Bins group channel values into equal inclusive ranges. At 256 bins each bin holds one value, at 64 bins four (0 to 3, 4 to 7 and so on) and at 16 bins sixteen. With 64 bins, the values 0 and 3 share the first bin and 4 opens the second.
The Transparency setting decides what happens to see-through pixels. Ignore fully transparent pixels skips pixels with alpha 0 and counts every other pixel once, whatever its opacity. Composite on white and Composite on black blend every pixel onto that color first. A red pixel at alpha 128 becomes 255, 127, 127 on white and 128, 0, 0 on black.
In ignore mode a fully transparent image has nothing to count, and the page asks you to pick a background. Browsers store canvas pixels premultiplied by alpha, so in ignore mode the colors read back from half-clear pixels are approximate. In one test ramp, 1,026 of 2,048 such pixels changed red value.
What the CSV holds
Copy CSV and Download CSV give the same text. It opens with the image width and height, the color space, the transparency option, the counted and ignored pixel totals and the luminance formula. A bin_start,bin_end,red,green,blue,luminance header then starts one row per bin, each with exact whole-number counts.
The CSV always holds all four channels, whichever Channel view is on screen. It does not hold the image or its file name, although the download is named after your file, so photo.jpg gives photo-histogram.csv. If the browser blocks the clipboard, the page selects the CSV in a text box so you can copy it yourself.
Exact counts by bin opens the same numbers as a table under the chart, formatted for your language settings. Use it to read one bin without leaving the page, or to check a bar you pointed at on the chart.
Limits
The tool reads one image at a time, and a new file replaces the current one. It measures the image and never changes it. There is no equalization, levels or curves control and no edited image to save.
Counts come from the decoded 8-bit sRGB pixels in the browser, not from RAW sensor data or 16-bit samples. Color management, wide-gamut or HDR conversion and decoder differences can shift values compared with a photo editor. Orientation from the file is applied. An animated image gives its first frame, and a multipage TIFF gives its first page.
The tool sets no file-size or pixel limit. A very large image can run out of browser memory. If that happens while counting, the page shows an error and keeps the image loaded, so you can analyze it again. Cancel & clear stops the count and releases the image.
Questions
What is the histogram of an image?
An image histogram is a bar chart of how many pixels sit at each value. Here red, green, blue and luminance each get a count for every value from 0 to 255, grouped into 256, 64 or 16 bins. Every counted pixel adds one to each channel, so the bars of any channel add up to the counted total.
What does a dark image histogram look like?
Its bars crowd toward the left, near 0. A bright image leans right, toward 255, and a low-contrast image bunches into a narrow band. Switch Channel to Luminance for a single brightness curve, and switch Scale to Logarithmic when one tall bar flattens the rest of the shape.
How do I create a histogram of an image?
Open the image with Choose image, keep Transparency at Ignore fully transparent pixels and Bins at 256, and select Analyze image. The chart first shows the RGB overlay. Pick Red, Green, Blue or Luminance under Channel for one curve, then use Download CSV to keep the exact counts.
Why do the counts differ from my photo editor?
The tool counts the pixels your browser decodes, in 8-bit sRGB. A photo editor may read the original 16-bit or RAW data, apply another color profile, or plot brightness with its own formula. The transparency option, the bin count and the first-frame rule for animated files can also change the totals.
Which images can I open?
JPEG, PNG, WebP, GIF and the other formats your browser decodes open directly, and the tool adds decoders of its own for TIFF, AVIF and SVG. An SVG is drawn without running its scripts or fetching linked files, so missing fonts or images can change its pixels. A damaged or unsupported file shows an error.
Does my image leave this device?
No. The image is decoded and counted by a background worker in your browser on this device. The tool does not upload, log or store it. Reset, Cancel & clear, a new file or leaving the page frees the image and the CSV link held by the page.