This is a discussion on Converting Nikon camera RAW images to JPEG,TIFF files using Adobe dll in C#.NET within the C# Programming forums, part of the Software Development category; Convert NEF into jpeg or tiff Goals: This porject is used to convert NEF files into Jpeg or Tiff. Steps: ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Convert NEF into jpeg or tiff Goals: This porject is used to convert NEF files into Jpeg or Tiff. Steps: 1) Create a C# windows application project. 2) create a button control. 3) add the library reference of Adobe Photshop Type Library 8.0 4) Add the namespace using ps = Photoshop; using PhotoshopTypeLibrary; using K = PhotoshopTypeLibrary.PSConstants; 5) copy the following code. ps.ActionDescriptorClass ad = new Photoshop.ActionDescriptorClass(); ps.ApplicationClass app = new ps.ApplicationClass(); // specify the filename ad.PutPath((int)K.phEnumNull, "D:\\WorkArea\\FLASH\\UploadedFiles\\Monalisa.NEF" ); ps.ActionDescriptorClass ad2 = new Photoshop.ActionDescriptorClass(); ad2.PutString(app.CharIDToTypeID("CMod"), "Nikon D70"); // camera model ad2.PutEnumerated((int)K.phTypeColorSpace, (int)K.phTypeColorSpace, (int)K.phEnumAdobeRGB1998); // color space ad2.PutEnumerated((int)K.phTypeBitDepth, (int)K.phTypeBitDepth, (int)K.phEnumBitDepth16); // bit depth ad2.PutInteger((int)K.phKeySizeKey, 3008); // the width... why? ad2.PutDouble((int)K.phKeyResolution, 240.0); // DPI int ReUnID = app.CharIDToTypeID("ReUn"); // ??? ad2.PutEnumerated(ReUnID, ReUnID, app.CharIDToTypeID("PpIn")); // maybe this forces it ad.PutObject((int)K.phKeyAs, app.StringIDToTypeID("Adobe Camera Raw"), ad2); // identifies the target object app.ExecuteAction((int)K.phEventOpen, ad, (int)ps.PsDialogModes.psDisplayNoDialogs); app.Quit(); 6) run the application. Last edited by oxygen : 08-03-2007 at 11:04 PM. |
|
#2
| |||
| |||
| Hi Oxygen, I am also working on the raw images conversion processing. Really its good for me. But in my project i have support all kinds of RAW images. do you have conversion for any other RAW image types? particularly i need for CRW,RAF type RAW images. It will be good if u give some idea on this. Thanks ![]() |
|
#3
| |||
| |||
| Hi Oxygen, Is there any simple way to convert the NEF image into JPEG or TIFF using Photoshop DLL. Thanks... S.Balasubramanian.. |
|
#4
| |||
| |||
| Hi bala, You can use the below snippets for conversion. Photoshop.ApplicationClass app = new Photoshop.ApplicationClass(); app.Visible = false; app.DisplayDialogs = Photoshop.PsDialogModes.psDisplayNoDialogs; Photoshop.JPEGSaveOptionsClass jpgs = new Photoshop.JPEGSaveOptionsClass(); Photoshop.TiffSaveOptionsClass tiffs = new Photoshop.TiffSaveOptionsClass(); jpgs.Quality = 8; Photoshop.Document ps = app.Open(@"D:\pt.NEF", null); ps.SaveAs("D:\\psaveimage", jpgs, null,2); ps.SaveAs("D:\\saveImage1", tiffs, null, 2); ps.Close(null); ps = null; app.Quit(); app = null; hope its useful
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
|
#5
| |||
| |||
| Oxs I tried ur new code to convert the CRW files,but it say 'Out of Memory' issue. I have to implement these option in my prjoct very shortly. Please help me to come out from this issue. |
|
#6
| |||
| |||
| Hi, I have tried to convert raw images using DCRAW. Dcraw is a raw converter used to convert more than 244 different types of raw images into tiff or jpg or ppm. Dcraw source can be download from the site Decoding raw digital photos in Linux as C or C++ source. Dcraw converts the raw image with Exif properties. Supported raw formats: CRW, CR2, MRW, NEF, RAF, etc.. Dcraw exe can be download from http://www.insflug.org/raw/. C# code to call dcraw exe: Process proc = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo("dcraw.exe", "-T D:\\sample.CR2"); startInfo.CreateNoWindow = true; startInfo.WindowStyle = ProcessWindowStyle.Hidden; startInfo.UseShellExecute = false; proc.StartInfo = startInfo; proc.Start(); while (!proc.HasExited) { } proc.Close();
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extract IPTC Metadata from jpeg and tiff image formats | Balasubramanian.S | C# Programming | 27 | 08-13-2009 06:39 AM |
| Reading and writing EXIF meta data from jpg/jpeg,tiff images | oxygen | C# Programming | 1 | 02-03-2009 09:11 PM |
| Converting PDF to HTML through PHP | boylekim | PHP Programming | 0 | 12-29-2008 09:49 AM |
| Applying ICC profiles to a TIFF,JPEG files using C# | oxygen | C# Programming | 1 | 02-28-2008 10:42 PM |
| Reading IPTC data from Nikon camera RAW images,JPEG,TIFF files using Adobe dll in C# | oxygen | C# Programming | 1 | 02-28-2008 10:33 PM |
Our Partners |