Hello,
I need to convert a tiff file that has Lab colorspace to a pdf file, and preserve the Lab colorspace to the output pdf.
I used :
convert fileLAB.tiff output.pdf, or
convert fileLAB.tiff -colorspace Lab output.pdf
Also I tried to use folowing code snipet into a C source:
MagickWand* mw;
MagickWandGenesis();
mw = NewMagickWand();
MagickReadImage(mw,"fileLAB.tiff");
MagickSetImageColorspace(mw, LabColorspace );
MagickWriteImage(mw,"output.pdf");
DestroyMagickWand(mw);
MagickWandTerminus();
The problem is that the output.pdf has sRGB colorspace instead of original Lab colorspace.
Does anyone have a solution for preserve Lab colorspace to the putput.pdf ?
Thank you.
convert tiff to pdf
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert tiff to pdf
Some quick experiments using tiffimages to confirm suggests that IM always converts back to sRGB before writing the PNG.
However, tiff2png seems to preserve the Lab colorspace.
However, tiff2png seems to preserve the Lab colorspace.
snibgo's IM pages: im.snibgo.com
Re: convert tiff to pdf
I tried to convert tiff with Lab colorspace to png, using IM convert command.
Seems to be the same problem. The obtained png have sRGB colorspace.
Seems to be the same problem. The obtained png have sRGB colorspace.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert tiff to pdf
Did you try
Code: Select all
convert image.tif -set colorspace LAB -colorspace sRGB image.png
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert tiff to pdf
As far as I know, PNG colour channels are always red, green and blue.iosif aug wrote:The obtained png have sRGB colorspace.
snibgo's IM pages: im.snibgo.com
Re: convert tiff to pdf
It seems that the problem is converting Lab tiff in PNG.The PNG is always RGB(sRGB).
When is converted a CMYK tiff to pdf, IM converts tiff to PAM image format, and then put this image in pdf file.
In this case(CMYK), the resulting file has same colorspace as the input file .
There is a way in IM to choose image format inside pdf?
When is converted a CMYK tiff to pdf, IM converts tiff to PAM image format, and then put this image in pdf file.
In this case(CMYK), the resulting file has same colorspace as the input file .
There is a way in IM to choose image format inside pdf?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert tiff to pdf
PNG only supports pixel data in RGB channels. It does not support LAB or CMYK channels unless you have a profile to represent the conversion to that channel type.
When you save an image to PDF, it just puts a vector shell about the raster data. I believe the raster data should be in whatever image type you used when you created the PDF. But if you want to extract the raster data from the PDF, you need to use some other tool besides IM to extract it. I think that is pdfimage.
When you save an image to PDF, it just puts a vector shell about the raster data. I believe the raster data should be in whatever image type you used when you created the PDF. But if you want to extract the raster data from the PDF, you need to use some other tool besides IM to extract it. I think that is pdfimage.