Rank: Member
Groups: Guest
Joined: 5/31/2006(UTC) Posts: 20
|
Hi, i tried to save a Aurigma RGB Image with transparency as a cmyk image. Unfortunatly, the transparency displays as white. What do i wrong? The barcode.HasAlpha Flag says true! Here is the Code: Code://this function is called from main()
private void test1()
{
Aurigma.GraphicsMill.Bitmap barcode = getBarcodeImg();
//Assing output CMYK profile for conversion
barcode.ColorManagement.CmykColorProfile = new Aurigma.GraphicsMill.ColorProfile(
@"C:\Projekte\zeiser\download\Adobe ICC Profiles\CMYK Profiles\EuropeISOCoatedFOGRA27.icc" );
barcode.ColorManagement.ConvertToContinuous(
Aurigma.GraphicsMill.ColorSpace.Cmyk, barcode.HasAlpha, false );
barcode.Save( "test.tif" );
}
private Aurigma.GraphicsMill.Bitmap getBarcodeImg()
{
Aurigma.GraphicsMill.Bitmap barcode = new Aurigma.GraphicsMill.Bitmap( 200,200, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);
Graphics g = barcode.GetGdiplusGraphics();
Rbarcode1D bc = new Rbarcode1D();
bc.Code = "12345678";
bc.BarType = Rbarcode1D.tbarType.CODE128;
bc.BarFontColor = Color.FromArgb( 221, 200, 171 );
bc.ForeColor = Color.FromArgb( Aurigma.GraphicsMill.Color.FromCmyk(100,100,255,255) );
bc.BarBackColor = Color.FromArgb( 255, 255, 255, 255 );
bc.paintBarcode( g );
return barcode;
}
Edited by user Wednesday, December 19, 2007 4:19:30 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Member
Groups: Guest
Joined: 5/4/2006(UTC) Posts: 17
|
I'm having the same problem, although it doesn't seem to be CMYK that causes the problem. I loose the alpha channel whenever I save as TIFF, regardless of color mode (RGB, CMYK or GrayScale). Try saving it as RGB TIFF to see if the transparency is lost in that situation aswell.
The only way I've been able to keep the alpha channel is by saving in PNG format (only RGB and GrayScale supported for PNG).
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello, I have tried the following code: Code:
private void Test()
{
Aurigma.GraphicsMill.Bitmap barcode = GetBarcodeImg();
barcode.ColorManagement.CmykColorProfile = new Aurigma.GraphicsMill.ColorProfile(@"c:/cmykconvert.icm");
barcode.ColorManagement.ConvertToContinuous(Aurigma.GraphicsMill.ColorSpace.Cmyk, barcode.HasAlpha, false);
barcode.Save(@"d:/temp/TransparentCMYK.tif");
barcode.Load(@"d:/temp/TransparentCMYK.tif");
if(!barcode.HasAlpha)
MessageBox.Show("Bitmap has no alpha channel.");
}
private Aurigma.GraphicsMill.Bitmap GetBarcodeImg()
{
return new Aurigma.GraphicsMill.Bitmap(200, 200, Aurigma.GraphicsMill.PixelFormat.Format32bppArgb);
}
Everything works correctly, Adobe Photoshop shows 5 channels inculding alpha. Which editor do you use to view channels? |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 5/4/2006(UTC) Posts: 17
|
Dmitry, you're absolutely right about the channels. The saved TIFF image DOES have a channel with alpha data. I also found it when looking under the Channels tab i Photoshop. However, I cannot get Photoshop, InDesign or MS Office Document Imaging to recognize it as an alpha channel. It's just another channel. When I save the same image in PNG format (only RGB or GrayScale supported) the alpha channel is recognized by these applications.
How can I get Photoshop to recognize the alpha channel?
Edit: Spelling...
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello,
It is very strange... I create CMYK image with alpha channel by Graphics Mill for .NET, save it to TIFF, then load it by Photoshop, convert in to RGB in Photoshop and save it to TIFF. So we have RGB TIFF file with alpha channel. This file is loaded correctly by different imaging software - e.g. by Windows Picture and Fax Viewer.
Which operations do you want to perform using CMYK images with alpha in Photoshop? |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 5/4/2006(UTC) Posts: 17
|
Maybe I don't fully understand the concepts of transparency and alpha channels, but what I would like to do is this: 1. Open an image with transparency (for example "Ducky.tif") with Graphics Mill for .NET. 2. Resize, convert to different color space or do nothing. 3. Save image as TIFF or PNG with transparency. Everything works as expected except saving the image as TIFF with transparency. As you can see in the attached image, transparency is lost when saving as TIFF. Instead there is a new channel called "Alpha 1", but neither Photoshop nor InDesign recognize it as transparency. Saving as PNG works fine. Here is my simple code to open "Ducky.tif" and save "OpenAndSave.tif" and "OpenAndSave.png": Code:
Bitmap gmImage = new Bitmap(Server.MapPath("Ducky.tif");
gmImage.Save(Server.MapPath("OpenAndSave.tif"), new TiffEncoderOptions(Aurigma.GraphicsMill.Codecs.CompressionType.None));
gmImage.Save(Server.MapPath("OpenAndSave.png"), new PngEncoderOptions(false));
Dmitry, when you open a TIFF image with alpha channel created by Graphics Mill for .NET in Photoshop, do you get transparency? / Mattias Malm The first image is the original created in Photoshop and opened with Graphics Mill for .NET. The second image is the TIFF saved from Graphics Mill for .NET. The third image is the PNG saved from Graphics Mill for .NET. Edited by user Monday, December 21, 2009 3:01:11 AM(UTC)
| Reason: Not specified Mattias Malm attached the following image(s):
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello,
It seems our alpha channel is recognized as mask layer by Photoshop. We try to solve this problem.
At this moment we can advise you to use the following workaround in Photoshop - load TIFF file created by Graphics Mill for .NET with transparency. Go to channels palette and select RGB or CMYK channels (the first channel), then click with CTRL on alpha channel. After that choose Magic Wang tool and left click on image. Select "Layer Via Cut" in context menu. After that you see new channel with correct transparency in backgound. |
|
|
|
|
Rank: Newbie
Groups: Guest
Joined: 7/3/2014(UTC) Posts: 1
|
Not quite familiar with the CMYK channels. However, as respect to the barcode part, I noticed that be quite interesting to study some free code to recognize barcode in .net. I had recently visited some barcode tool websites, and I imagine that would some barcode knowledge be helpful to this question?
|
|
|
|
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.