Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Image Processing
  3. Image Histogram
Add to favorites

Image Histogram

Count every pixel into 256 bins per channel, with the luminance definition named rather than assumed: Rec. 709, Rec. 601 or CIE L*. Exports the whole table as RFC 4180 CSV.

Edits stay in your browserMore image processingJump to full guide

Initializing in your browser…

You might also like

Image to Base64

Turn an image into a data URL whose payload is decoded again and compared byte for byte with the file, with the media type taken from the file's own signature rather than its extension and the size cost of embedding stated in full.

Image Diff Comparator

Compare two images with a perceptual engine (pixelmatch) that ignores anti-aliasing, or an exact byte engine. Groups changes into regions with bounding boxes, reports SSIM, and handles size mismatches with an explicit policy.

Image Cropper

Whole-pixel crops with the rectangle typed or dragged, checked by decoding the output and comparing it with the pixels that went in. Quarter turns and mirrors are exact permutations, so nothing is clipped.

Image Histogram: a worked example

A 200 by 200 test image of four equal blocks: pure red, pure green, pure blue and mid grey, 10,000 pixels each.

Input

primaries.png · 40,000 pixels · luminance channel
What Image Histogram produces

Where the four blocks land

Rec. 709  blue 18   red 54   grey 128  green 182
Rec. 601  blue 29   red 76   grey 128  green 150
CIE L*    blue 32   red 53   grey 54   green 88

The same four colours, counted three ways. Pure red is bin 54 under Rec. 709 and bin 76 under Rec. 601, a difference of 22 levels, and CIE L* puts grey and red almost on top of each other because it measures lightness rather than a weighted sum of stored values. A histogram can only show one of the three, which is why this one names the definition it is using.

What is Image Histogram?

Count the pixels of an image into 256 bins per channel and see the tonal distribution as a chart. The luminance definition is yours to choose (Rec. 709, Rec. 601 or CIE L*), each one named with the document it comes from, and fully transparent pixels are left out by default rather than counted as black.

How to use

  1. 1Upload an image
  2. 2Pick the luminance definition you want counted: Rec. 709 matches sRGB, Rec. 601 matches Photoshop's Luminosity channel, CIE L* is perceptually even
  3. 3Decide whether fully transparent pixels are left out or counted as black
  4. 4Read the chart and the statistics, then export the full table as CSV if you need the numbers

Where this helps

  • Exposure evaluation

    See where the tones actually sit, with the mean quoted against the scale it is measured on.

  • Colour cast detection

    Overlay the three channels and compare where each one peaks.

  • Checking a transparent PNG

    Find out how many pixels are fully transparent and keep them out of the counts, instead of reading a false spike of black.

  • Taking the numbers elsewhere

    Export every bin as CSV and analyse the distribution in a spreadsheet or a script.

Key features

  • Exact 256-bin counts for red, green, blue and alpha, checked against an independent implementation
  • Three named luminance definitions: ITU-R BT.709-6, ITU-R BT.601-7 and CIE L*
  • Fully transparent pixels reported and excluded by default, because a canvas returns them as black
  • Median under any of the nine Hyndman and Fan quantile definitions
  • Mode reported as every tied bin rather than the first one found
  • Clipping bands stated as bin ranges, with the arbitrariness of the width said out loud
  • Linear, logarithmic, cumulative and normalized views
  • RFC 4180 CSV export of the whole table, plus a chart PNG and a statistics summary

How it works

Every pixel is read through the Canvas API and counted into 256 bins per channel. The counts are exact integers and nothing is sampled or downscaled: on a generated fixture whose contents are known in advance, the red, green and blue bins match Pillow's own Image.histogram() reading of the same file bin for bin.

The interesting part of a histogram is not the counting, it is the two decisions that are usually made silently. The first is what luminance means, and there is no single answer. Rec. 601 luma (ITU-R BT.601-7 table 3) weights the stored values 0.299, 0.587 and 0.114; those are the standard-definition television coefficients, and they are what Photoshop's Luminosity channel uses. Rec. 709 luma (ITU-R BT.709-6 item 3.2) weights them 0.2126, 0.7152 and 0.0722; sRGB uses the Rec. 709 primaries, so those are the coefficients that belong to the colours in the file. CIE L* undoes the sRGB transfer function first (IEC 61966-2-1), computes relative luminance Y in linear light, and converts it with CIE 15 clause 8.2.1.1, which is the only one of the three that is a luminance rather than a luma and the only one whose axis is perceptually even. Pure red lands at bin 76 under Rec. 601, bin 54 under Rec. 709 and L* 53. That is a spread of 22 levels on one colour, so the tool names the definition in use rather than calling any of them "the standard formula", and switching between them recounts without re-reading the file.

The second decision is transparency. A canvas stores premultiplied alpha, so a fully transparent pixel is handed back as black whatever colour the file records for it. Counting those pixels puts a spike at bin 0 of every channel exactly as tall as the number of transparent pixels, and not one of them is black in the file. The default is to leave them out and say how many there were; the other choice is offered beside it with what it does spelled out. On a test image of 20,000 red pixels with 2,000 of them fully transparent, counting them moves the mean luminance from 54.0 to 48.6.

Statistics come with the definition each one rests on. The median is a quantile, and there are nine definitions of a quantile in Hyndman and Fan (1996) that give different answers on the same data; all nine are offered and type 7 (R, NumPy, Excel PERCENTILE.INC) is the default. The mode is every bin that ties for the largest count, not the first one found. The clipping bands are the bottom and top 2 percent of the scale, and the page says that the width of a band is a choice rather than a measurement. The tonal split is in equal thirds of whichever scale the active channel uses, so an L* histogram is not divided at 85 and 170. Every reading is scoped to the pixels actually counted, and the page states whether the bins add up to that number.

The CSV export goes through an RFC 4180 writer: CRLF record separators per section 2.1, a header row naming the luminance definition, and one row per bin carrying red, green, blue, alpha and luma. A chart PNG and a statistics summary are also available. Everything happens in the browser and the picture is never uploaded.

Frequently asked questions

Which luminance definition should I use?

Rec. 709 if you want the coefficients that belong to sRGB, which is what your file almost certainly is. Rec. 601 if you are comparing against Photoshop, whose Luminosity channel uses it. CIE L* if you want an axis where equal steps look equally different, which is the only one of the three that is a real luminance rather than a weighted sum of gamma-encoded values.

Why do the three definitions disagree so much?

Because they are different quantities. Pure red is bin 76 under Rec. 601, bin 54 under Rec. 709 and L* 53. A histogram can only show one of them, so it should say which.

What happens to transparent pixels?

A canvas stores premultiplied alpha, so a fully transparent pixel comes back as (0, 0, 0) whatever colour the file records. By default those pixels are left out and the count is shown; you can also count them, and the page says that doing so puts a spike at bin 0 that is not a colour in the image.

Why is there a choice of median?

A quantile of a finite sample is not uniquely defined. Hyndman and Fan (1996) set out nine definitions and different software picks different ones, so the tool names the one in use and lets you change it.

Can I edit the image from here?

No, the histogram is a reading. Use the Image Filters or Colour Grader tools to change the picture.

Related tools and how they differ

  • Image Color Palette Extractor: Counts distinct colours rather than per-channel levels, and reports what share of the picture each one covers.

Private by design

Images are decoded, edited, and exported entirely inside this browser tab. No originals, exports, or metadata are uploaded.