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!
