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



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 12, 2006 1:09:52 AM(UTC)


Groups: Registered
Posts: 1

I am creating individual thumbnails from a multi-page tif (102 pages) by calling RasterCodecs.ReadThumbnail(fileName, options, pageNumber). This call takes 4seconds in total for all 102 pages. Grayscaling the 102 thumbnails takes another 4 seconds. My options are setup in the following way:

options.LoadStamp = false;
options.BitsPerPixel = 8
options.Resample = true;
options.Order = RasterByteOrder.Gray;
options.PaletteFlags = ColorResolutionCommandPaletteFlags.None;
options.DitheringMethod = RasterDitheringMethod.Clustered;

It takes 13seconds in total to size the thumbnails.
SizeCommand command2 = new SizeCommand();
command2.Flags = RasterSizeFlags.Resample;
command2.Width = desiredWidth;
command2.Height = desiredHeight;

With all the other code it takes a total of 27seconds to create the 102 thumbnails and display them.

Is there something I can try to speed up this process?



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 : Tuesday, December 12, 2006 10:47:35 AM(UTC)


Groups: Registered, Tech Support, Administrators
Posts: 766

Depending on your hardware, this seems pretty normal for what you are trying to do.  As far as LEADTOOLS is concerned, the only thing you can do to speed it up would be changing your SizeCommand.Flags property to RasterSizeFlags.Normal.  This will be faster but will create a lower quality image.

From a basic programming perspective, you might be able to refactor your code some and reduce some of the processing done inside your loop.  For example, don't declare anything (such as the line  SizeCommand command2 = new SizeCommand();) inside the loop.  Instead you should declare your variables outside of the loop to save on processing time.  This might not save up that much time, but if 102 thumbnails is only a test case and you might be loading thousands, the frivolous processor instructions will add up.  Take a look at your code and see what other general refactoring you can do to reduce the number of instructions you are carelessly executing.

Also, once you deploy your application and build under Release mode, it should speed up a little.
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-2020, Yet Another Forum.NET
This page was generated in 0.161 seconds.