Your problem is not using color profiles with convert and ImageMagick.
I guarantee that you will have the same problem with these commands:
convert sourcefile.pdf output.pdf convert -density 600 sourcefile.pdf output.pdf
Your real problem is using ImageMagick for a task in which it is bad. Since ImageMagick cannot work with PDF files. It can only work with bitmap images. Here he excels and where he is really really good.
Since PDF files are not bitmaps (although they may contain them), ImageMagick uses a delegate to convert PDF pages to single full-page images. This delegate is ghostscript.
Only after receiving the delegation result (bitmap) does ImageMagick start working on your profile changes. After that, he converts the image back to PDF - but now the PDF has lost all the old vector objects, and only a pixelated version is left from each page.
Just as you cannot return the meat in one piece, as soon as you chop it through a meat grinder - you cannot return the original PDF objects (vector images, fonts, etc.) as soon as you "Rasterized its pages, such like ImageMagick. "
Solution for your problem (messing with color profiles, used PDF files) :. Use the right tool for the job. Learn to use Ghostscript directly ! (Because Ghostscript can embed ICC color profiles in PDF files without changing pages in bitmaps first. You don't need ImageMagick for this!)
source share