Re: 16 bit grayscale tiff

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I want to process 16 bit grayscale tiff images.

Gdiplus does not support 16bpp grayscale images.

Microsoft's newest imaging library WIC(Windows Imaging Component) does
support 16bpp grayscale images.

See:
http://www.microsoft.com/downloads/details.aspx?FamilyID=8e011506-6307-445b-b950-215def45ddd8&displaylang=en

And:
http://www.microsoft.com/downloads/details.aspx?FamilyID=A6D6EC6A-E4F2-405E-842D-7C3BCB5B1390&displaylang=en


"Fabian" <Fabian@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:10930D5C-3F30-44DC-B4E6-AE146AECE94A@xxxxxxxxxxxxxxxx
I want to process 16 bit grayscale tiff images. My first tests show that
somehow the images are not read correctly. If I just read and save an
image
the resulting image on the disk is only 8 bytes in size. It works though
if I
load a 8 bit grayscale tiff or a 24 bit color bmp instead.

A code snippet:

<snip>

// init GDI+
ULONG_PTR GdiplusToken;
GdiplusStartupInput GdiplusStartupInput;
GdiplusStartup(&GdiplusToken, &GdiplusStartupInput, NULL);

// create Bitmap from disk
WCHAR wchPath[255] = L"F:\\IppTestImages\\NOISE.TIF";
Bitmap* bitmap = new Bitmap(wchPath, NULL);

// save Bitmap
WCHAR wchSavePath[255] = L"F:\\changed.TIF";
CLSID tiffClsid = GUID_NULL;
GetEncoderClsid(L"image/tiff", &tiffClsid);
bitmap->Save(wchSavePath, &tiffClsid, NULL);

// delete Bitmap
delete bitmap;

// uninit GDI+
GdiplusShutdown(GdiplusToken);

</snip>

The GetEncoderClsid-function is from the msdn example at
http://msdn2.microsoft.com/en-us/library/ms533843(VS.85).aspx.

Strangely the meta information is there: bitmap->GetWidth() returns the
proper width.

Thanks in advance for your help,

Fabian


.



Relevant Pages

  • Re: Unable to save pic file as jpg file
    ... > saves them as BITMAP only which takes up a large amount ... Internet Explorer Saves Images As ... Digital Image Support Center ...
    (microsoft.public.windowsxp.photos)
  • Re: Very Large Bitmaps
    ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > spaces and 16-bit images etc without the horrible ambiguity and missing ... A bitmap is loaded and expanded to an uncompressed raster so 18000 * ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Finding Mona
    ... anomolies. ... We can see that even the tiniest bitmap image sticks out like a sore thumb. ... I made a specific hypothesis based on the nature of bitmap images. ... The techniques I listed included statistics. ...
    (talk.origins)
  • Re: Did you know
    ... over bitmap formats if the number of information points are less than ... the svg file in one icon. ... Now try putting that PNG icon at something approaching a usable resolution. ... It doesn't scale better than bitmap images. ...
    (comp.sys.mac.advocacy)
  • Re: Did you know
    ... over bitmap formats if the number of information points are less than in the bitmap. ... Imagine the difference when we have to put four different version of the svg file in one icon. ... Vector graphics scale better than raster graphics, so you don't need as many copies to handle the same range. ... Some kind of art suffers, but that can be solved by having several vector images for certain key sizes. ...
    (comp.sys.mac.advocacy)