Images for 16-colors and over 256-colors

What should I do with bitmap images. User can have 16-colors or
256-colors or more. Good looking bitmaps are okay when 256-colors or
more, but almost nothing looks good when only 16-colors.

How to check how many colors are in a display?
How to store different images easily?

Any succestions?