Rank: Advanced Member
Groups: Guest
Joined: 3/3/2008(UTC) Posts: 185
Thanks: 8 times
|
Hi, Test Case: 1. Use camera to capture photo in aRGB profile, and use adobe photoshop to do minor editing - DSC_1821_ori.jpg 2. When in photoshop still opening DSC_1821_ori.jpg, go to "Edit" -> "Convert to profile" -> select the target profile to be sRGB IEC61966-2.1 -> save as - DSC_1821_AdobeConvert.jpg 3. Use the code below to convert DSC_1821_ori.jpg to sRGB profile, and save as DSC_1821_ConvertedSrGB.jpg 3. Create a small app, put DSC_1821_ori.jpg, DSC_1821_ConvertedSrGB.jpg, DSC_1821_AdobeConvert.jpg in one Multilayer View, and do an export (snip code 2) Result: the result from DSC_1821_ori.jpg and DSC_1821_ConvertedSrGB.jpg does not seems to give good result. The color being turn dull... Kindly advise if we did anything wrong on this... We tried to do the code below to convert the photo from adobe RGB to sRGB Code:
Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(@"D:\Photos\Testcase\DSC_1821_ori.jpg");
bitmap.ColorManagement.ColorManagementEngine = Aurigma.GraphicsMill.Transforms.ColorManagementEngine.LittleCms;
if (System.IO.File.Exists(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "sRGB IEC61966-2.1.icm")))
{
bitmap.ColorManagement.TargetColorProfile = new Aurigma.GraphicsMill.ColorProfile(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "sRGB IEC61966-2.1.icm"));
bitmap.ColorManagement.Convert(Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);
bitmap.Save(@"D:\Photos\Testcase\DSC_1821_ConvertedSrGB.jpg", new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(100, true));
}
put all 3 into MLV Code:
Aurigma.GraphicsMill.WinControls.MultiLayerViewer mlv = new MultiLayerViewer();
System.Windows.Forms.Application.DoEvents();
mlv.Unit = Aurigma.GraphicsMill.Unit.Inch;
System.Windows.Forms.Application.DoEvents();
mlv.WorkspaceWidth = (float)25;
mlv.WorkspaceHeight = (float)10;
mlv.ZoomMode = Aurigma.GraphicsMill.WinControls.ZoomMode.BestFit;
mlv.Layers.Clear();
mlv.Layers.Add(new Layer("tmp"));
mlv.CurrentLayer = mlv.Layers[0];
Aurigma.GraphicsMill.Bitmap bmp = new Bitmap(@"D:\Photos\Testcase\DSC_1821_ori.jpg");
Aurigma.GraphicsMill.Bitmap bmp2 = new Bitmap(@"D:\Photos\Testcase\DSC_1821_ConvertedSrGB.jpg");
Aurigma.GraphicsMill.Bitmap bmp3 = new Bitmap(@"D:\Photos\Testcase\DSC_1821_AdobeConvert.jpg");
Aurigma.GraphicsMill.WinControls.ImageVObject targetVObject = new Aurigma.GraphicsMill.WinControls.ImageVObject(bmp, false, 0, 0);
targetVObject.Transform.Translate(0, 0, System.Drawing.Drawing2D.MatrixOrder.Append);
targetVObject.Update();
System.GC.Collect();
Aurigma.GraphicsMill.WinControls.ImageVObject targetVObject2 = new Aurigma.GraphicsMill.WinControls.ImageVObject(bmp2, false, 0, 0);
targetVObject2.Transform.Translate((25 / 3) * 72, 0, System.Drawing.Drawing2D.MatrixOrder.Append);
targetVObject2.Update();
System.GC.Collect();
Aurigma.GraphicsMill.WinControls.ImageVObject targetVObject3 = new Aurigma.GraphicsMill.WinControls.ImageVObject(bmp3, false, 0, 0);
targetVObject3.Transform.Translate(((25 / 3) * 2) * 72, 0, System.Drawing.Drawing2D.MatrixOrder.Append);
targetVObject3.Update();
System.GC.Collect();
mlv.Layers[(int)0].VObjects.Add(targetVObject);
mlv.Layers[(int)0].VObjects.Add(targetVObject2);
mlv.Layers[(int)0].VObjects.Add(targetVObject3);
System.GC.Collect();
mlv.RenderWorkspace(300).Save(@"D:\Photos\Testcase\output.jpg", new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(100, true));
Edited by moderator Monday, April 15, 2013 6:14:51 PM(UTC)
| Reason: Not specified
|