Rasterize PDF to TIF (in CMYK)
Rasterize PDF to TIF (in CMYK)
hello,
i've a request.
I work for a typography, often from external service we receive bad pdf materials.
(RGB, low DPI, etc)
Is there any way to user IM to rasterize them and obtain a .tif with 300dpi in CMYK ?
Thank you fo rany info?
m.
i've a request.
I work for a typography, often from external service we receive bad pdf materials.
(RGB, low DPI, etc)
Is there any way to user IM to rasterize them and obtain a .tif with 300dpi in CMYK ?
Thank you fo rany info?
m.
Re: Rasterize PDF to TIF (in CMYK)
garbage in, garbage out..
The best would be to receive better pdf files.
You can convert to CMYK with e.g. "convert input -colorspace CMYK output.tif", but this itself won't improve your images (rather worsen them). A better solution is to use profiles. If you know the input color profile (if the pdf uses only rgb images without profile, it's probably sRGB), you can can use commands like that:
convert input -strip -profile inputprofile -profile "U.S. Web Coated (SWOP) v2.icc" output.tif
(See here.)
For the rasterizing process, super-sampling can be good sometimes. For example, if you want your final image to have 100dpi, you could first rasterize at a multiple of that:
convert -density 400 input -resample 100 output
But this all heavily depends on your input PDFs. If you have problems with one file, you could upload it - so that some users can test it.
The best would be to receive better pdf files.

You can convert to CMYK with e.g. "convert input -colorspace CMYK output.tif", but this itself won't improve your images (rather worsen them). A better solution is to use profiles. If you know the input color profile (if the pdf uses only rgb images without profile, it's probably sRGB), you can can use commands like that:
convert input -strip -profile inputprofile -profile "U.S. Web Coated (SWOP) v2.icc" output.tif
(See here.)
For the rasterizing process, super-sampling can be good sometimes. For example, if you want your final image to have 100dpi, you could first rasterize at a multiple of that:
convert -density 400 input -resample 100 output
But this all heavily depends on your input PDFs. If you have problems with one file, you could upload it - so that some users can test it.
Re: Rasterize PDF to TIF (in CMYK)
read manual and arrive at -profile solution
this is my command line :
convert -density 300 -quality 100 -profile "profile.icm" in.pdf out.pdf
using this as input : http://www.webalice.it/t.bavaro/in.pdf
and try these as profiles: http://www.webalice.it/t.bavaro/my_profiles.zip
result are bad, black in special mode is 'dirty', anyone can improve command line to obtain
best output possible ?
Thank you again,
m.
this is my command line :
convert -density 300 -quality 100 -profile "profile.icm" in.pdf out.pdf
using this as input : http://www.webalice.it/t.bavaro/in.pdf
and try these as profiles: http://www.webalice.it/t.bavaro/my_profiles.zip
result are bad, black in special mode is 'dirty', anyone can improve command line to obtain
best output possible ?
Thank you again,
m.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Rasterize PDF to TIF (in CMYK)
You want to read the input pdf before setting your profiles, but after setting the density. Seeconvert -density 300 -quality 100 -profile "profile.icm" in.pdf out.pdf
http://www.imagemagick.org/Usage/basics/#cmdline
and
http://www.imagemagick.org/Usage/formats/#profiles (see the part about changing colorspace from cmyk to rgb)
Re: Rasterize PDF to TIF (in CMYK)
Apart from that: I looked at your 'in.pdf'. With this file, you don't even need color profiles if you want CMYK - it's already CMYK.
Provided that you have a current version of ImageMagick and Ghostscript, you can use the following two commands:
('gswin32c' is valid only in Windows.)
I think this should give you the best quality for a 300dpi CMYK image. My result was this file. (Link deleted)
Directly calling Ghostscript probably looks a bit more difficult, but the process is quicker that way and it ensures that you will get the correct colors. (But note that this command is only for CMYK, not RGB PDFs.) And the super-sampling ensures that all vector-graphics are antialiased. (Though in your example, it doesn't make that much of a difference, so you could just rasterize it at 300dpi - instead of rasterizing it at 1200dpi and then resampling to 300dpi.)
If you want to convert the CMYK TIF to RGB, you should use "US Web Coated SWOP" as input color profile.
For a comparison - this is the 300dpi output of the Windows Adobe Reader: file (Link deleted)
(I often compare the IM/Ghostscript output to the Adobe output. It's easier to get correct results there. Though one only gets RGB with Adobe Reader.)
Provided that you have a current version of ImageMagick and Ghostscript, you can use the following two commands:
Code: Select all
gswin32c -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=tiff32nc -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r1200 -sOUTPUTFILE="temporary.tif" in.pdf
convert temporary.tif -resample 300 -compress zip out.tif
I think this should give you the best quality for a 300dpi CMYK image. My result was this file. (Link deleted)
Directly calling Ghostscript probably looks a bit more difficult, but the process is quicker that way and it ensures that you will get the correct colors. (But note that this command is only for CMYK, not RGB PDFs.) And the super-sampling ensures that all vector-graphics are antialiased. (Though in your example, it doesn't make that much of a difference, so you could just rasterize it at 300dpi - instead of rasterizing it at 1200dpi and then resampling to 300dpi.)
If you want to convert the CMYK TIF to RGB, you should use "US Web Coated SWOP" as input color profile.
For a comparison - this is the 300dpi output of the Windows Adobe Reader: file (Link deleted)
(I often compare the IM/Ghostscript output to the Adobe output. It's easier to get correct results there. Though one only gets RGB with Adobe Reader.)
Last edited by Drarakel on 2010-09-25T23:19:30-07:00, edited 1 time in total.
Re: Rasterize PDF to TIF (in CMYK)
Thank you all for reply.
now i'm testing some thing, but 'forgot' to specify some details.
my final destination is printing on industrial CTP:

this device works succesfully with .tif CMYK 300 dpi files. Print other thing, but if you have
problem with pages, is possible to trick it rasterizing. Lost quality but page go out.
I search the way to offer an hot folder to my users, where put .pdf or .ps and obtain best .tif possible.
I dont love to much Adob3 products, and use that people did.
IM solved always my problem, so i want to put also in my production flow.
My task is to port .pdf.ps to CMYK, (99% time stuff arrive in this format), then obtain .tif.
Like a lot Ghostscript solution, thank you.
m.
now i'm testing some thing, but 'forgot' to specify some details.

my final destination is printing on industrial CTP:

this device works succesfully with .tif CMYK 300 dpi files. Print other thing, but if you have
problem with pages, is possible to trick it rasterizing. Lost quality but page go out.
I search the way to offer an hot folder to my users, where put .pdf or .ps and obtain best .tif possible.
I dont love to much Adob3 products, and use that people did.
IM solved always my problem, so i want to put also in my production flow.
My task is to port .pdf.ps to CMYK, (99% time stuff arrive in this format), then obtain .tif.
Like a lot Ghostscript solution, thank you.
m.
Re: Rasterize PDF to TIF (in CMYK)
done some step. but i must take a choice.
Tiff are very good, my users can take them and convert to .ps using photo editing software..
Anyone know good solution to convert Drarakel .tif to .ps in batch mode ?
http://home.vrweb.de/~data/temp/in-300d ... (cmyk).tif
thank you again for your time,
m.
Tiff are very good, my users can take them and convert to .ps using photo editing software..
Anyone know good solution to convert Drarakel .tif to .ps in batch mode ?
http://home.vrweb.de/~data/temp/in-300d ... (cmyk).tif
thank you again for your time,
m.
Re: Rasterize PDF to TIF (in CMYK)
I'm having problems when using ImageMagick for writing PS. But there are probably a lot of other ways to create the files.
I'm not using PS much, so it would be really better if someone else could give hints for this.
If you don't get the expected results with ImageMagick, you could try with Ghostscript:
I think, this creates a CMYK PS file. Note that supersampling is not possible this way, so you will have some jagged eges.
But I'm not sure now what your target is. You need partly TIFs, but also sometimes (rasterized) PS files..?
I'm not using PS much, so it would be really better if someone else could give hints for this.
If you don't get the expected results with ImageMagick, you could try with Ghostscript:
Code: Select all
gswin32c -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 -sDEVICE=pswrite -dTextAlphaBits=4 -dGraphicsAlphaBits=1 -r300 -sOUTPUTFILE="in-300dpi.ps" in.pdf
But I'm not sure now what your target is. You need partly TIFs, but also sometimes (rasterized) PS files..?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Rasterize PDF to TIF (in CMYK)
I don't use PS much but for batch converting, you want to use -mogrify. see http://www.imagemagick.org/Usage/basics/#mogrify
Re: Rasterize PDF to TIF (in CMYK)
An alternative for the commandline is e.g. Xpdf. Here, you could use something like that:
This writes a CMYK PS file - and keeps it vectorial, which is better anyway.
My best try with ImageMagick to create a rasterized CMYK PS (out of the formerly created TIF) was this:
You has to specify the density as 407dpi (at least when reading it with Ghostscript), then you will get the original image out of this PS (the upper and right border is a bit enlarged).
The above IM command writes a 'false' BoundingBox value, but in my tests this seemed to be necessary.(?) With the default (without the page setting), a 'correct' BoundingBox value is written - but then I only get a cropped image out of the PS (cropped to A4 size?). Strange..
Code: Select all
pdftops -level2sep -paper match in.pdf in.ps
My best try with ImageMagick to create a rasterized CMYK PS (out of the formerly created TIF) was this:
Code: Select all
convert in-300dpi_gs_r(cmyk).tif -page 2395x3500 PS3:test.ps
The above IM command writes a 'false' BoundingBox value, but in my tests this seemed to be necessary.(?) With the default (without the page setting), a 'correct' BoundingBox value is written - but then I only get a cropped image out of the PS (cropped to A4 size?). Strange..