Loading...

8bpp grayscale - only 16 colors? why?

Discussions about image processing in GdPicture.NET using GdPictureImaging.

8bpp grayscale - only 16 colors? why?

Postby felix » Tue Nov 29, 2011 11:26 am

Edit: SOLVED!
FxGrayscale() made 256 colors to 16 colors.



Hi everybody!

I have an image as DIB and show this in the GdPicture Viewer.
From there I save the image as TIF with GdImage.SaveAsTIFF. Usually this image is a grayscale image with 8bpp and 256 colors. After saving it, it is an image with only 16 colors left. Why?
The histogram doesn't show any gradient, just 16 peaks.

How can I save the image with full 256 colors (8bpp)? Is it a bug or am I doing something wrong?

Here is what I do:
1. Scan (Retrieve image and save in DIB (IntPtr))
2. Cut image (m_GdImage.CreateClonedGdPictureImageArea)
3. Set DPI (SetHorizontalResolution, SetVerticalResolution)
4. Set MetaData (TagSoftwareUsed, TagArtist, TagCopyright, TagEquipModel, TagDocumentName)
5. (This is new, it hasn't been done before but doesn't make any difference!) If image is 8bpp: FxGrayscale() on image)
6. SaveAsTIFF(image, path, Compression.None)

And I am sure the image I get is a true 8bpp grayscale image. The saved one is, as written before, an 8bpp image with 16 colors left (indexed colors).
I checked all of that with GIMP.

Thanks in advance!
Last edited by felix on Tue Nov 29, 2011 12:52 pm, edited 1 time in total.
felix
 
Posts: 13
Joined: Mon Apr 19, 2010 2:54 pm

Re: 8bpp grayscale - only 16 colors? why?

Postby Loïc » Tue Nov 29, 2011 12:51 pm

Hi,

Please provide a code snippet that reproduces the problem. This error as no sense to me, there is probably something wrong in your process.
You can provide a demo app via http://support.gdpicture.com Please also provide your resulting image.

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: 8bpp grayscale - only 16 colors? why?

Postby felix » Tue Nov 29, 2011 12:52 pm

SOLVED!

FxGrayscale() made 256 colors to 16 colors. Without the function, I get the full 256 colors I need.
felix
 
Posts: 13
Joined: Mon Apr 19, 2010 2:54 pm

Re: 8bpp grayscale - only 16 colors? why?

Postby Harry » Wed Dec 07, 2011 5:46 pm

the problem is NOT solved because we can't get a non indexed grayscale image with 256 colors ?!?
Harry
 
Posts: 40
Joined: Fri Mar 20, 2009 1:21 pm


Return to Image Processing

Who is online

Users browsing this forum: No registered users and 0 guests