Good library to load images of different formats - c#

Hi Iam developing an image viewer application just like irfan-view or acdsee which should be capable to view lots of different image file formats (not just the standard ones which can be done with System.Drawing.Image).
Iam currently using ImageMagick but it isn't very fast and seems to be unstable with some image files.
Can anyone suggest a good imaging library, ideally with a .NET wrapper already present?

I am not sure about .NET wrapper but FreeImage library is rather good. As I know it is faster than imageMagick, and less buggy.

There is the DevIL image library that comes with the DevIL.NET wrapper.

Related

Using libpng in C#

if you want to save the image in PNG format you can use ImageFormat class of .Net.
But this class doesn't implemented compression for PNG files.
And for some reasons i can't save my file in JPEG format.
After Some researched i know libpng is the official PNG reference library.
But i can't find anything for using it in .net framework.
Does anyone know about this library and using it in .NET?
About libpng
Thanks in Advanced.
Another alternative: PngCs
But this class doesn't implemented compression for PNG files
What on earth does that mean? PNG is compressed by design.
ImageMagick is a very nice library that allows you (among other things) create PNG files.
Magick.NET is the .Net wrapper for this library. Using this library, you can simply convert/create image formats. E.g. from their documentation:
using (MagickImage image = new MagickImage("Snakeware.gif"))
{
image.Write("Snakeware.jpg");
}
Since libpng it's written in C ( ANSI C, even better ) you can build a bridge between that library and your C# application -> Use a C library from C# code
There are also other options, such as freeimage and the port of ImageMagick to .net but in this case it's still unclear to me what kind of project is this one, I don't get if it's official or not, if it's already dead or alive, if you are interested you can search for that name.
In simple terms PNG it's a open standard where JPEG it's a world full of patents and royalties, for this reason some libraries do not offer jpeg features or they offer a limited set of jpeg related features/algorithms. PNG it's also a real imaging standard about a file format definition, jpeg it's more like a container.

Converting pdf to tiff using C# .net 3.0 or less without 3rd party libraries?

There are several SO posts and googling which did not really help much with my question. So here I go again.
I need to convert a PDF to a single tiff image (multi-page tiff obviously). I have figured out the tiff creation part. But the issue is with extracting a image/bitmap from pdf. Of course c# .net does not have the functions, but there should be way to do it.
On why I dont want to use third party libraries, its because they are not free - some may be, but for security reasons it may not be usable in all environments. And more than everything just curious how to do it and in some posts this question is being treated as a sin :).
Any proper methods/ideas or where to start would be helpful. I would prefer WPF based solutions than GDI+ based, as I have seen issues with GDI+ tiff creation solution on windows servers . I was of the idea that creating pdf is more difficult and of course I can understand if it was easy it should have been in .net already.
Edit: Also for a starter, a pdf which contains a simple format would be nice. Not necessary that it should support every type of pdf.
Even with 3rd party it's not going to be easy :) Convert a PDF into a series of images using C# and GhostScript

Is there any alternate way to processing DICOM images using WPF in C# without any third party/Library?

I started working in a new project with a big challenge. I am working in a medical project and in that I have to read DICOM images and process the image with its properties. I gathered some basic knowledge on DICOM and PACS. As I worked on WPF around 2 years of my career so I choose to do this project using C# and WPF. I googled a lot and even I went through many articles in SO and also in codeproject, every where I found they used some libraries/ third party tools like:
gdcm , LEADTOOLS , ClearCanvas
Can any body suggest me any alternate way of doing DICOM Image processing without using any third party/library or is it impossible without using libraries/third party ?
I have gone through the link for choose a best suitable library for DICOM image processing, but looking for an alternate way to solving this.Please feel free to suggest which is the best and more flexible library from the above list only if there is not any alternate way to achieve the task.
Any idea, link, suggestion or any initiation will be appreciated, thanks in advance.
In one way or another the third-party libraries are also created from scratch, so of course it is possible to create a DICOM image processing solution without relying on any third-party libraries. Using whole or parts of an open-source library will most certainly take you to a functional solution in considerably shorter time, though.
One third-party library that is mentioned in the link you are referring to is mdcm. This is a relatively light-weight open-source library with support for WPF (and Silverlight). If you want to, I am pretty sure you should be able to extract those parts from this library that are relevant to your project.
Another light-weight library is Evil DICOM. I am not completely sure that this library has very much image processing functionality, though.
UPDATE MAY 31: SUMMARY OF DISCUSSION
mdcm is an open-source library under the LGPL license. An example of image rendering usage is given in the SL.DicomToXml (Silverlight) application, equally applicable to WPF applications. In the code-behind of the MainPage, fileNameButton_Click method, there is code to demonstrate DICOM image file loading and rendering.
There is currently no up-to-date binary distribution of mdcm available, but it should be fairly easy to build required libraries from the solution in the mdcm repository. Source code can either be obtained using a Git client or by downloading the latest revision by clicking on the ZIP button on the repository home page.
If you need to get more acquainted with DICOM image processing details, it is probably good to start by having a look at the DICOM Standard itself, and also to parse a DICOM image file to get the feeling for what information it contains. A good starting point is the official DICOM homepage. A quick introduction with links to software is given here. There is also a general, more lengthy tutorial available here.

Highlighting PDFs programatically in .net - are there any APIs or Libraries to generate offset file or is there a better method?

I need to programatically highlight PDFs on the fly, preferrably using the highlight file method.
Are there any .net programming libraries to generate a xml highlight offsets file for a pdf? Doesnt have to be open source or free.
I tried converting PDFBox to a .net DLL using IKVM and it did not work correctly. Im not terribly excited about the memory footprint of the entire java class library in the DLL anyway.
a second option would be to regenerate and highlight the source PDF, if there are any libraries / APIs that will do this to a PDF relatively easily that would work too, but I have not found any in my searches.
thanks in advance.
I dont know if this has solution for your requirement, but this is a good opensource api to work with PDF. I will be so happy if it could help your needs.
http://itextsharp.sourceforge.net/tutorial/index.html

How to load EPS files and draw them using WinForms

Is it possible to load and display EPS file using plain WinForms GDI+? If not, is there a free library to help out?
I seem to remember that Windows GDI supported EPS files, but after Googling around a bit, I am starting to doubt that memory.
All I want to do is load the file and draw it using a Graphics context.
I am aware that I can just use any program to convert the file to PNG or something and render it that way, but because I am trying to render at multiple resolutions, I would prefer to keep the vector data in the EPS file.
Thanks!
All the free or open source libraries I know that can convert EPS to other vector or raster format are all based on Ghostscript. You can invoke ghostscript directly, with wrapper provided or alternatively look at imagemagick. It is a very popular library for manipulating image graphics and has been around for a long time. It also internally relies on Ghostscript for handling EPS format. There is a .NET wrapper for it that you can find at http://imagemagick.codeplex.com/. You can read a bit about its background here too http://www.codeproject.com/KB/dotnet/ImageMagick_in_VBNET.aspx. There is also pstoedit that is also based on ghostscript to read EPS and allow export to format like WMF. You will need to the call to pstoedit API using interop in .NET
Besides Ghostscript there are several commercial products that I known of like ImageGear and LeadTools which will let you take EPS to almost any other kind of graphic formats.
You can use GhostScript to produce images from an EPS. Once you have an image you can then display that within your application.
In your question you indicated you want the output in a vector format which would preclude bitmaps, jpeg etc. Here are a couple of ways of getting a XAML file which is a vector file with extensive support by Microsoft.
Microsoft Expression Blend 3 and Design 3 can both open .ai (eps) files and convert them to vector formats, design and XAML respectively, so it is definitely possible.
I know it is relatively easy to automate most Microsoft Office applications like Word and Excel, but I have not seen any documented com inter-op assemblies for these Expression products.
Perhaps you can use the converters that are part of Expression in an undocumented way?
If that doesn't work here is plan B:
Here is a free converter that will convert .ai (eps) files to XAML. To use it you need Adobe Illustrator however.

Categories

Resources