Meet us at PRINT 19. Chicago, IL. Oct. 3 - 5.
Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
yaodao  
#1 Posted : Sunday, April 28, 2019 5:50:40 AM(UTC)
yaodao

Rank: Newbie

Groups: Member
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

Fedor  
#2 Posted : Sunday, April 28, 2019 8:44:47 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,617

Thanks: 5 times
Was thanked: 67 time(s) in 65 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

thanks 1 user thanked Fedor for this useful post.
yaodao on 4/28/2019(UTC)
Users browsing this topic
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.