Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, April 2, 2009 2:39:45 AM(UTC)


Groups: Registered
Posts: 6

I´m using the Leadtools 16v and C#.
I want to open a tiff 8 bit fray scale image, but when I load it like this:

RasterImage im;
im = codecs.Load(@"C:\tif\1.tif");

The problem is that whem I load the image, automatically is convert to a indexed color.
There is any way to load a greyscale (8bit) image maintaining the color format.

Thank you

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, April 2, 2009 11:10:02 AM(UTC)


Groups: Registered, Tech Support, Administrators
Posts: 764

RasterCodecs.Load is an overloaded function.  This overload uses default properties and is probably using Bgr or BgrOrGray.  If the TIF doesn't have information stating that it's grayscale (most don't) then we're likely going to default to bgr.  Use one of the overloads that lets you specify the CodecsLoadByteOrder and use CodecsLoadByteOrder.Gray.
#3 Posted : Sunday, April 5, 2009 9:35:28 PM(UTC)


Groups: Registered
Posts: 6

I have tried that, but it doesn´t work because must be a 12 or 16-bit grayscale image and the image I want to load is a 8-bit grayscale image. So the program gives an error when must execute that instruction.
Thanks for the answer.
#4 Posted : Monday, April 6, 2009 2:35:08 AM(UTC)

Adnan Ismail  

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

I can see you wrote that the image is 8 bits per pixel. In that case it will always load as palettized into LEADTOOLS. All images from 1 to 8 BPP will have a palette in our RasterImage object.
The CodecsLoadByteOrder.Gray byte order is only valid for extended grayscale images in LEADTOOLS (basically 12 to 16 bits gray).

If the source file was non-palettized 8-bit TIFF, LEADTOOLS will automatically create a grayscale palette for it that ranges from RGB(0,0,0) to RGB(255,255,255).

If you want to save a grayscale TIFF image without a palette, set the value of the NoPalette Property to true in the CodecsTiffSaveOptions class.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2023, Yet Another Forum.NET
This page was generated in 0.081 seconds.