bpp (colour depth)

Started by Malko on 15-Jan-2014/17:49:52-8:00
Hello, Is there a simple way to know the 'bpp' of an image (colour depth) ? I have tested several stuff with the rgb refinement but cannot achieve any good result. Thanks in advance.
Probably best to use ImageMagick. There's an old Imagemagick-helper script from 2006(I haven't used it): http://www.rebol.org/view-script.r?script=imagemagick-helper.r There was also an R3 project in 2010 (also haven't tried it, but may help put in the right direction): http://www.colineau.fr/rebol/R3_extensions.html#section-4
Actually, I expect there's also a Windows API function for that...
Thank you Nick. I already use ImageMagic for that purpose. As far as I can see, the proposals require the use external library. I was expecting something 'rebol only' that does not require use of external application, library, etc. :) Anyway, I will read more in-deep the proposed links to see if something helpful can be taken. Could you please confirm me that the image datatype refinement only allow : size, rgb and alpha. It's already good for but isn't there any other available refinement ?
I haven't had to do this before. Can't you determine this just by evaluating the list of colors in the image?: R E B O L [] colors: copy [] img: logo.gif repeat i length? img [append colors pick img i] colors: unique colors editor colors foreach c colors [probe c/1 probe c/2 probe c/3] ask "Continue..." Cyphre is the guy to talk with about graphics in Rebol. He's available on AltME (that's really the best place to talk with the rest of the community).
Yeah, bad idea, out of memory...

Reply