Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
ToGdiPlusBitmap - colour profile preservation
Rank: Newbie
Groups: Guest
Joined: 3/8/2016(UTC) Posts: 2
|
When using ToGdiPlusBitmap, is there a way to preserve the colour profile in the same way that GDI+ itself does when you load an image and pass the appropriate parameter: public static Image FromStream( Stream stream, bool useEmbeddedColorManagement ) If I use GraphicsMill to load the image (ImageReader.Create) then use ToGdiPlusBitmap(), the colours in the image look incorrect (or at least different!) when compared to the same image loaded using Image.FromStream with the useEmbeddedColorManagement parameyter set to true. Is there any way round this? Thanks!
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
The colors are displayed incorrectly when an image has non-sRGB color space. So the easiest way to fix the problem is to convert an image to sRGB. Code:var gmBitmap = new Aurigma.GraphicsMill.Bitmap("../../../Copenhagen_RGB.jpg");
gmBitmap.ColorManagement.DestinationProfile = Aurigma.GraphicsMill.ColorProfile.FromSrgb();
gmBitmap.ColorManagement.Convert(gmBitmap.PixelFormat.HasAlpha ?
Aurigma.GraphicsMill.PixelFormat.Format32bppArgb : Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);
var sdBitmap = gmBitmap.ToGdiPlusBitmap();
pictureBox1.Image = sdBitmap;
Edited by user Wednesday, March 9, 2016 5:41:29 AM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 3/8/2016(UTC) Posts: 2
|
Excellent - that works. Thanks Fedor.
|
|
|
|
Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
ToGdiPlusBitmap - colour profile preservation
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.