Home   Archive   Permalink

bpp (colour depth)

A year ago, I asked about a a simple 'rebol only' way to know the 'bpp' of an image (colour depth).
Recently, I found this interesting article :
Based on that article, it is possible to estimate the bpp of an image like :
img: load %image.png
sze: size? %image.png
x: img/size/x
y: img/size/y
bpp: ((sze * (8 * 1024)) / (x * y)) / 1000

posted by:   Malko       28-Mar-2015/20:34:22-7:00

I would at least replace sze: size? %image.png by sze: length? img
This way you get the size of the image as not compressed. The file size is not relevant as we have no idea how much it has been compressed.

posted by:   GregP       30-Mar-2015/5:09:38-7:00

I red and quick tested in night-session time on uncompressed picture (with half-closed eyes (and brain)... ;) ;) .
Thanks for the precision/correction.

posted by:   Malko       30-Mar-2015/6:18:23-7:00