Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

16 bit greyscale to 4 bit image translation

3 views
Skip to first unread message

Ömer KAYA

unread,
Aug 26, 2010, 3:19:04 AM8/26/10
to
Hello All;

I am in the middle of a project and we are tying to produce different kinds of test data; i need at least an image with 8000 x 8000; which will be a big dataset (for us)

what i have is a 16 bit greyscale image i need to produce a 4 bit image out of it i tried it on png file with;

A=imread('...');
imwrite(A,'4bitpng.png','bitdepth',4);

bu unfortunately it gives me a unit 8 image... what i need is unit 4 image and also the image is so dark how can i make it much more presentable?

Regards to all

Ömer KAYA

ImageAnalyst

unread,
Aug 26, 2010, 6:36:49 AM8/26/10
to
A 4 bit image will be dark, unless you display it properly, because
the gray levels only go up to 15.
4 bits is not an allowable bit depth with imwrite. Divide your data
by 1024 and save it as 8 bit, then display using
imshow(imageArray, []);
so it won't show up as dark.
0 new messages