This project has moved and is read-only. For the latest updates, please go here.

How to reduce time while converting j2k image to bitmap using MagickImage dll?

Feb 13, 2014 at 6:05 AM
I am loading j2k images(by converting into Bitmap) using MagickImage.dll in c#.

sample code of loading j2k image in c# is :
 MagickImage image = new MagickImage(fileName);
  Bitmap bitmap= image.ToBitmap();
  pictureBox.Image=bitmap;
It is loading properly but taking a long time for e.g. 10-12 seconds per image. Can anybody tell how to reduce the time while converting image to Bitmap?

Thanks in advance.
Feb 13, 2014 at 7:34 AM
Can you add a link to one of your images?
Feb 13, 2014 at 8:48 AM
Sorry,I can't include images here but i have 30 j2k images of size 73.9 kb each and folder size is 2.12 mb.I am loading all images at one time it is taking near about 2 minutes and for one image it is taking near about 40 seconds
Feb 13, 2014 at 8:51 AM
Edited Feb 13, 2014 at 9:07 AM
Can you post them on dropbox or contact me through Codeplex to email them to me? And which version of Magick.NET are you using?
Feb 13, 2014 at 9:27 AM
I am using Magick.NET-6.8.8.201-Q16-x86-net40-client.
j2k image:
Image
Image
Feb 13, 2014 at 10:28 AM
Can you first upgrade to the latest version and see if you can replicate the problem? The links to your images are not working.
Feb 13, 2014 at 10:34 AM
Please open this discussion page on google chrome then you will see the image icons properly.(on other browsers it is not seen properly)
don't know from where to get the latest version of this dll ,so can you please send me the link of same.
Feb 13, 2014 at 10:42 AM
Press the 'DOWNLOADS' button in the menu to get the latest version. I will try if I can reproduce your problem with the latest version during my lunch break.
Feb 13, 2014 at 10:46 AM
Edited Feb 13, 2014 at 11:11 AM
Thank you.
Magick.NET-6.8.8.501-Q16-x86-net40-client
is this a latest version?
I am facing same problem with this.
Feb 13, 2014 at 7:40 PM
You are now using the latest version. The problem seems to be that ToBitmap now uses ImageFormat.Png to create the bitmap. When you use ToBitmap(ImageFormat.Bmp) the bitmap will be created much faster. I will make ImageFormat::Bmp the default in the next version of Magick.NET.
Feb 14, 2014 at 6:07 AM
Edited Feb 14, 2014 at 6:13 AM
I have checked that by using ToBitmap(ImageFormat.Bmp).It gives me error for some images,
i.e. "MagicK: unable to decode image file".
Feb 14, 2014 at 8:02 AM
Edited Feb 14, 2014 at 8:04 AM
That error message is from reading an incorrect j2k file. Changing ToBitmap() to ToBitmap(ImageFormat.Bmp) should not not affect this.