This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
ChingYen  
#1 Posted : Thursday, March 14, 2013 9:51:34 PM(UTC)
ChingYen

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

File Attachment(s):
Resize.zip (6,390kb) downloaded 11 time(s).
Eugene Kosmin  
#2 Posted : Thursday, March 14, 2013 11:39:04 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Guest
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
Hi ChingYen,

Try to replace TargetColorProfile to RgbColorProfile:

Code:

Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(@"DSC_1821_ori.jpg");

bitmap.ColorManagement.ColorManagementEngine = ColorManagementEngine.LittleCms;

bitmap.ColorManagement.RgbColorProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();
bitmap.ColorManagement.Convert(Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);
bitmap.Save(@"srgb.jpg", new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(100, true));

TargetColorProfile is used for proofing and will be renamed in future versions to be more intuitive.

Best regards,

Eugene Kosmin

The Aurigma Development Team

thanks 1 user thanked Eugene Kosmin for this useful post.
ChingYen on 3/26/2013(UTC)
Users browsing this topic
Guest (3)
Forum Jump  
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.