Hi all,
Is there a way to convert PDF files to JPG files with clipping paths using ImageMagick?
PDF to JPG clipping path
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PDF to JPG clipping path
What is your IM version and platform? Post your PDF file so we can examine it.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PDF to JPG clipping path
Your pdf has no clip path (nor an 8bim profile to get it from). But the PDF does contain an image with a clip path. So you need to extract it from the PDF vector shell. Then you can combine them to make the background transparent. To do this you can use pdfimages tool. See https://manpages.debian.org/testing/pop ... .1.en.html. It is part of the poppler tools. See https://en.wikipedia.org/wiki/Pdfimages and https://poppler.freedesktop.org
Code: Select all
pdfimages -tiff example.pdf example
convert example-000.tif example-001.tif -alpha off -compose copy_opacity -composite example.png
Re: PDF to JPG clipping path
Thank you very much for the detailed clarification
Re: PDF to JPG clipping path
Just one more thing. In the example commands you showed me it's taking out a TIFF file out of the PDF and converting to PNG with IM.
I tried running
The output was 2 files:
* example-000.jpg
* example-001.ppm
but I was hoping I'd get the JPG file with a clipping path included.
Is there a way to combine those two into one JPG file with a clipping path using ImageMagick?
I tried running
Code: Select all
pdfimages -j example.pdf example
* example-000.jpg
* example-001.ppm
but I was hoping I'd get the JPG file with a clipping path included.
Is there a way to combine those two into one JPG file with a clipping path using ImageMagick?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PDF to JPG clipping path
No, IM can't write clipping paths. Gimp can.spittman wrote:Is there a way to combine those two into one JPG file with a clipping path using ImageMagick?
snibgo's IM pages: im.snibgo.com