Rank: Newbie
Groups: Guest
Joined: 4/28/2019(UTC) Posts: 1
Thanks: 1 times
|
How can I convert a rgb png image with transparent background to a cmyk png image with transparent background Code:using (var reader = ImageReader.Create(@"C:/temp/argb.png"))
using (var converter = new ColorConverter(PixelFormat.Format40bppAcmyk))
using (var writer = ImageWriter.Create(@"C:/temp/test_USWebCoatedSWOP.png"))
{
converter.DefaultSourceProfile = ColorProfile.FromSrgb();
converter.DestinationProfile = new ColorProfile(@"C:/temp/USWebCoatedSWOP.icc");
Pipeline.Run(reader + converter + writer);
}
here is my code , and it throw a exception Code:Aurigma.GraphicsMill.UnsupportedPixelFormatException
HResult=0x80131500
Message=The specified pixel format is not supported.
Source=Aurigma.GraphicsMill
StackTrace:
at Aurigma.GraphicsMill.GMException.ThrowManagedException(IntPtr unmanagedException)
at Aurigma.GraphicsMill.PipelineElement.RunPipeline()
at Aurigma.GraphicsMill.Pipeline.Run()
Edited by moderator Sunday, April 28, 2019 8:42:27 AM(UTC)
| Reason: Not specified
|
|
|
|
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 PNG format was designed for web graphics and doesn't support the CMYK color space. TIFF is the only format which supports CMYK and transparency. So just save to a TIFF file to solve the problem. |
Best regards, Fedor Skvortsov
|
1 user thanked Fedor for this useful post.
|
|
|
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.