Several ideas come to mind for storing histogram data. The obvious choice is to have one table (or three for individual R / G / B channels) that represents a (normalized) histogram, with a column for each bin. If you are in 24-bit color (8 bits / channel), you can divide each channel into 16 bits ([0-15], ..., [240-255]), and in each column the percentage of pixels that hit to this basket.
Something like that:
id imgID R_0_15 ... R_240_255 G_0_15 ... G_240_255 B_0_15 ... B_240_255
1 1234 0.1 0.23 0.023 0.234 0.11 0.01
With this design, the entire (normalized) histogram for each image will be presented as a single line in the table.
The queries will be a little complicated - you will need to generate them dynamically in order to include the names of the desired columns for the range of values ββof interest.
Perhaps the best way would be a HistogramBins table with a row for each image and each bin:
id imgID component bin_min bin_max percentage
1 1234 R 0 15 0.1
....omitted rows...
1 1234 R 240 255 0.23
...etc...
, . , , , "bin 1" . , , , .
, , "", , binning .
, . , !