1

I am trying to create a PDF file using Latex. However, Latex does not handle TIFF or any other image format capable of both transparency and CMYK. The only solution I think I can use is to convert the PNG image to PDF and embed those in the file.

I am somewhat familiar with imagemagick, however, I am having trouble figuring out how to convert a PNG (probably in the RGB/SRGB colour space) to a PDF in the CMYK colour space.

How do I go about doing this conversion so that the colours are correct and the transparency remains?

kojow7
  • 10,308
  • 17
  • 80
  • 135

1 Answers1

2

In Imagemagick, you should use a CMYK type profile to do the conversion:

convert input.png -profile USWebCoatedSWOP.icc output.pdf

Note, however, that Imagemagick will simply put the raster image into a vector PDF shell. It will not vectorize the image.

fmw42
  • 46,825
  • 10
  • 62
  • 80
  • Note, that convert needs to allow PDF: https://stackoverflow.com/a/53180170/1069083 – rubo77 Jun 29 '21 at 19:37
  • The profile USWebCoatedSWOP.icc doesn't work for me, the result of a brown image is somewhat blue, it looks like inverted colors. This is the image: https://i.stack.imgur.com/lfAmS.jpg – It seems like it is a problem of the huge size, if I convert it smaller and then use the same profile it converts fine to CMYK – rubo77 Jun 29 '21 at 20:11
  • 1
    `@rubo77` Your image is RGB without a color profile. To convert to CMYK you need two profiles. The first assigns an sRGB profile and the second converts to CMYK profile. So try `convert lfAmS.jpg -profile sRGB.icc -profile USWebCoatedSWOP.icc result.pdf`. This command works for me. Add the paths to where you have those profiles. – fmw42 Jun 29 '21 at 21:36
  • Thanks, this is working fine, also working with the Coated FOGRA39 profile from Adobe. I use this in the end: `convert input.png -profile sRGB.icc -profile CoatedFOGRA39.icc -units PixelsPerInch -density 600 output.pdf` – rubo77 Jun 30 '21 at 07:52